List <Token> getRightOp(object statment) { try //для инициализации массива { ArrayAssignment arrayAssignment = (ArrayAssignment)statment; _isMathRight = false; return(getArrayInitializtionList(arrayAssignment)); } catch //для математического выражения { MathStatment mathStatment = (MathStatment)statment; _isMathRight = true; return(getMathExpression(mathStatment)); } }
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(MathStatment mathStatment) { return(Constants.MATH_STATMENT); }