/**
         * Parse the AssignCommand that can be called from the parseCommand method
         * Command := V-name := Expression
         */
        Command parseAssignCommand()
        {
            VName VName = new VName(CurrentToken.getSpelling());

            acceptIt(); // Accept VName
            // then we expect the next token to be an operator (which should be an '=' sign)
            accept(Operator);
            return(new AssignCommand(VName, parseExpression()));
        }
Exemple #2
0
 public AssignCommand(VName vname, Expression exp)
 {
     this.vname = vname;
     this.exp   = exp;
 }