Метод из темы:
Код:
Method method = multipassAdmin.CompileSingleMethod(sourceCode) as Method;
Вернет чтото типа такого:
Код:
public abstract class MethodOrDelegate : CompilationUnit
{
// Methods
protected MethodOrDelegate();
// Properties
public AttributeList Attributes { get; internal set; }
public IList<LocalDeclaration> Locals { get; internal set; }
public string Name { get; internal set; }
public IList<ParameterDeclaration> Parameters { get; internal set; }
public IList<Statement> Statements { get; internal set; }
public XppType Type { get; internal set; }
}
Где:
IList<LocalDeclaration> Locals - локальные переменные в твоем кода.
IList<ParameterDeclaration> Parameters - параметры.
IList<Statement> Statements - структура кода в методе.
Например один из Statements может быть IF -
Код:
public class IfStmt : Statement
{
// Methods
public IfStmt();
public override string ToString(int indent);
// Properties
public Expression Condition { get; internal set; }
public Statement Consequent { get; internal set; }
}