Example #1
0
 public object Visit(ElseActionNode n, object o)
 {
     AppendLine($"{AddIndent()}else");
     AppendLine($"{AddIndent()}{{");
     IncreaseIndent();
     n.Actions.Accept(this, null);
     DecreaseIndent();
     AppendLine($"{AddIndent()}}}");
     return(null);
 }
Example #2
0
        private ActionNode ElseStatement()
        {
            ActionNode         itsAST;
            SourceCodePosition itsPos = _currentToken.SourcePosition;

            if (_currentToken.Type == Token.TokenType.Else)
            {
                Accept(Token.TokenType.Else);
                Accept(Token.TokenType.LeftBrace);
                ActionSequenceNode itsActions = ActionStatements();
                Accept(Token.TokenType.RightBrace);
                itsAST = new ElseActionNode(itsActions, itsPos);
            }
            else
            {
                itsAST = new EmptyActionNode(itsPos);
            }
            return(itsAST);
        }
Example #3
0
 public object Visit(ElseActionNode n, object o)
 {
     return(null);
 }