Esempio n. 1
0
        /// <summary>
        /// Parse an VariableExpression
        /// </summary>
        /// <returns>Parsed VariableExpression</returns>
        public VarExpression ParseVarExpression()
        {
            VarExpression varExpression = new VarExpression();

            CurrentToken = TokenStream.NextToken();
            varExpression.SetVariableIdentifier(CurrentToken.GetValue().ToString());

            return varExpression;
        }
Esempio n. 2
0
 public virtual void Visit(VarExpression expression)
 {
     VisitSubNodes(expression);
 }
Esempio n. 3
0
 /// <summary>
 /// Visit VarExpression
 /// </summary>
 /// <param name="expression">VarExpression to check</param>
 public override void Visit(VarExpression expression)
 {
     //Check if expression is assigned to existing variable
     if(!SymbolTable.ContainsVariable(expression.GetVariableIdentifier()))
     {   //Add undefined variable exception
         ExceptionList.Add(new UndefinedVariable(expression.GetVariableIdentifier()));
     }
 }