Exemple #1
0
        public LabelExpression parseLabelExpression()
        {
            LabelExpression label;

            if (currentTokenEquals(Token.TokenValue.VALUE_IDENTIFIER))
            {
                label = new LabelExpression(currentToken.stringValue);

                nextToken();

                nextTokenIfEquals(Token.TokenValue.TWOPOINTS);

                label.body = parseExpression();

                return label;
            }
            else
            {
                throw new SyntaxError(lineNumber, colNumber, Token.TokenValue.VALUE_IDENTIFIER);
            }
        }
Exemple #2
0
 public void addLabel(LabelExpression exp)
 {
     addLabel(exp.labelName, exp.body);
 }