Esempio n. 1
0
        private AbstractStatementNode ParseIfStatement()
        {
            _scanner.ExpectToken('(');
            var condition = _expressionParser.Parse(new CodePoint((byte)')'));

            _scanner.ExpectToken(')');

            var thenPart = ParseStatement();

            AbstractStatementNode elsePart = null;

            if (_scanner.HaveIdentifier(KeywordElse))
            {
                elsePart = ParseStatement();
            }

            return(new IfStatement(condition, thenPart, elsePart));
        }
Esempio n. 2
0
 public LabelStatement(UserLabel label, AbstractStatementNode statement)
 {
     Label     = label;
     Statement = statement;
 }
Esempio n. 3
0
 public IfStatement(AbstractSyntaxTree condition, AbstractStatementNode thenPart, AbstractStatementNode elsePart)
 {
     Condition = condition;
     ThenPart  = thenPart;
     ElsePart  = elsePart;
 }