public override bool Visit(AstStatementsBlock node)
 {
     ErrorIfIsNull(node.Statements);
     return true;
 }
Esempio n. 2
0
 public AstClassMethod(
     AstVisibilityModifier visibility,
     AstStaticModifier staticMod,
     AstIdExpression typeDef,
     AstIdExpression name,
     AstArgumentsDefList argumentsDefinition,
     AstStatementsBlock statementsBlock
 )
 {
     Visibility = visibility;
     Static = staticMod;
     TypeDef = typeDef;
     Name = name;
     ArgumentsDefinition = argumentsDefinition;
     StatementsBlock = statementsBlock;
 }
 public override bool Visit(AstStatementsBlock node)
 {
     return true;
 }
Esempio n. 4
0
 public AstIfStatement(AstExpression cond, AstStatementsBlock thenBlock, AstStatementsBlock elseBlock)
 {
     Condition = cond;
     ThenBlock = thenBlock;
     ElseBlock = elseBlock;
 }
Esempio n. 5
0
 public AstWhileStatement(AstExpression cond, AstStatementsBlock block)
 {
     Condition = cond;
     Statements = block;
 }
Esempio n. 6
0
        // #STATEMENTS_BLOCK #STATEMENTS
        private void ConstructStatementsBlock()
        {
            var astStatementsList = nodes.Pop() as AstStatementsList;

            var block = new AstStatementsBlock(astStatementsList);
            PushNode(block);
        }
Esempio n. 7
0
 // #STATEMENTS_BLOCK PASS LINE_END
 private void ConstructPassStatementsBlock()
 {
     var statementsList = new List<AstStatement>();
     var astStatementsList = new AstStatementsList(statementsList);
     var block = new AstStatementsBlock(astStatementsList);
     PushNode(block);
 }
Esempio n. 8
0
        // #IF_THEN_STATEMENT IF LEFT_PAREN #OR_TEST RIGHT_PAREN BLOCK_START #STATEMENTS_BLOCK BLOCK_END
        private void ConstructIfThenStatement()
        {
            var thenBlock = nodes.Pop() as AstStatementsBlock;
            var orTest = nodes.Pop() as AstExpression;

            var elseBlock = new AstStatementsBlock(new AstStatementsList(new List<AstStatement>()));
            var ifThenStmt = new AstIfStatement(orTest, thenBlock, elseBlock);
            PushNode(ifThenStmt);
        }
 public override bool Visit(AstStatementsBlock node)
 {
     var stmts = node.Statements.Statements;
     for (var i = 0; i < stmts.Count; ++i)
     {
         var stmt = stmts[i];
         if (stmt is AstReturnStatement && i < stmts.Count - 1)
         {
             DispatchError(stmts[i + 1].TextPosition, "Unreachable code detected");
             return false;
         }
     }
     return true;
 }
Esempio n. 10
0
 public abstract bool Visit(AstStatementsBlock node);