public override bool Visit(AstStatementsBlock node) { ErrorIfIsNull(node.Statements); return true; }
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; }
public AstIfStatement(AstExpression cond, AstStatementsBlock thenBlock, AstStatementsBlock elseBlock) { Condition = cond; ThenBlock = thenBlock; ElseBlock = elseBlock; }
public AstWhileStatement(AstExpression cond, AstStatementsBlock block) { Condition = cond; Statements = block; }
// #STATEMENTS_BLOCK #STATEMENTS private void ConstructStatementsBlock() { var astStatementsList = nodes.Pop() as AstStatementsList; var block = new AstStatementsBlock(astStatementsList); PushNode(block); }
// #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); }
// #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; }
public abstract bool Visit(AstStatementsBlock node);