public static NonTerm CreateTypeDecl(BaseSymbol typeToken) { return(new NonTerm(NonTermType.Type, typeToken)); }
public static void GetVarDecl(BaseSymbol nonTerm, out Token typeDeclaration, out Token id) { typeDeclaration = nonTerm.Symbols[0] as Token; id = nonTerm.Symbols[1] as Token; }
public static NonTerm CreateNewStatement(BaseSymbol expression) { return(new NonTerm(NonTermType.NewStatement, expression)); }
public static void GetNewStatement(BaseSymbol nonTerm, out Token expression) { expression = nonTerm.Symbols[0] as Token; }
public static void GetAssignVarStatement(BaseSymbol nonTerm, out BaseSymbol variable, out BaseSymbol expression) { variable = nonTerm.Symbols[0]; expression = nonTerm.Symbols[1]; }
public static void GetAssignIdStatement(BaseSymbol nonTerm, out Token idToken, out BaseSymbol expression) { idToken = nonTerm.Symbols[0] as Token; expression = nonTerm.Symbols[1]; }
public static void GetWhileStatement(BaseSymbol nonTerm, out BaseSymbol expression, out BaseSymbol statement) { expression = nonTerm.Symbols[0]; statement = nonTerm.Symbols[1]; }
public static void GetPrintStatement(BaseSymbol nonTerm, out BaseSymbol expression) { expression = nonTerm.Symbols[0]; }
public static NonTerm CreateIfElseStatement(BaseSymbol expression, BaseSymbol statementIf, BaseSymbol statementElse) { List <BaseSymbol> declarations = new List <BaseSymbol>() { expression, statementIf, statementElse }; return(new NonTerm(NonTermType.IfElseStatement, declarations)); }
public static void GetElseStatement(BaseSymbol nonTerm, out BaseSymbol statement) { statement = nonTerm.Symbols[2]; }
public static void GetFormalArgumentDeclaration(BaseSymbol nonTerm, out Token typeDeclaration, out Token argumentId) { typeDeclaration = nonTerm.Symbols[0] as Token; argumentId = nonTerm.Symbols[1] as Token; }
public static BaseSymbol CreateArrayDecl(BaseSymbol type, int arrayDimention) { (type as Token).CountArrayDimention = arrayDimention; return(type); }
public static NonTerm CreateExtendsClause(BaseSymbol id) { return(new NonTerm(NonTermType.ExtendsClause, id)); }
public static void GetMethodDecl(BaseSymbol nonTerm, out Token typeDeclaration, out Token methodId, out List <BaseSymbol> variables, out BaseSymbol statements, out BaseSymbol returnExpression) { GetMethodSignature(nonTerm, out typeDeclaration, out methodId, out variables); statements = nonTerm.Symbols[3]; returnExpression = nonTerm.Symbols[4]; }
public static void GetMethodSignature(BaseSymbol nonTerm, out Token typeDeclaration, out Token methodId, out List <BaseSymbol> variables) { typeDeclaration = nonTerm.Symbols[0] as Token; methodId = nonTerm.Symbols[1] as Token; variables = nonTerm.Symbols[2].Symbols; }