예제 #1
0
        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);
        }
예제 #2
0
        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);
        }