public static List <Token> getMathExpression(MathStatment mathStatment) { List <Token> tokens = new List <Token>(); MathExpression mathExpression = (MathExpression)mathStatment.getTokensList()[0]; foreach (object item in mathExpression.getTokensList()) { tokens.AddRange(getFactor(item)); } if (tokens.Count > 1) { SortExpression.getSortedExpression(tokens); } return(tokens); }
public static List <Token> getMathExpression(MathStatment mathStatment) { List <Token> tokens = new List <Token>(); MathExpression mathExpression = (MathExpression)mathStatment.getTokensList()[0]; foreach (object item in mathExpression.getTokensList()) { tokens.AddRange(getFactor(item)); } if (!Program.isArrayElementLeft) { SemanticAnalizer.checkCompareTypes(Program.varibleName, Constants.INT); } return(tokens); }
static public string visit(MathExpression mathExpression) { return(Constants.MATH_EXPRESSION); }