Esempio n. 1
0
	void Imperative_stmt(out ProtoCore.AST.ImperativeAST.ImperativeNode node) {
		node = null; 
		if (la.kind == 29) {
			Imperative_ifstmt(out node);
		} else if (la.kind == 32) {
			Imperative_whilestmt(out node);
		} else if (la.kind == 33) {
			Imperative_forloop(out node);
		} else if (la.kind == 10) {
			Imperative_languageblock(out node);
		} else if (la.kind == 37) {
			Get();
			if (la.kind != _endline)
			   SynErr(Resources.SemiColonExpected);
			
			Expect(23);
			node = new ProtoCore.AST.ImperativeAST.BreakNode(); NodeUtils.SetNodeLocation(node, t); 
		} else if (la.kind == 38) {
			Get();
			if (la.kind != _endline)
			  SynErr(Resources.SemiColonExpected);
			
			Expect(23);
			node = new ProtoCore.AST.ImperativeAST.ContinueNode(); NodeUtils.SetNodeLocation(node, t); 
		} else if (IsAssignmentStatement() || IsVariableDeclaration()) {
			Imperative_assignstmt(out node);
		} else if (StartOf(4)) {
			Imperative_expr(out node);
			if (la.kind != _endline)
			  SynErr(Resources.SemiColonExpected);
			
			Expect(23);
		} else if (la.kind == 23) {
			if (la.kind != _endline)
			  SynErr(Resources.SemiColonExpected);
			
			Get();
		} else SynErr(102);
	}
Esempio n. 2
0
        void Imperative_stmt(out ProtoCore.AST.ImperativeAST.ImperativeNode node)
        {
            node = null;
            if (la.kind == 29) {
            Imperative_ifstmt(out node);
            } else if (la.kind == 32) {
            Imperative_whilestmt(out node);
            } else if (la.kind == 33) {
            Imperative_forloop(out node);
            } else if (la.kind == 7) {
            Imperative_languageblock(out node);
            } else if (la.kind == 43) {
            Imperative_ThrowStatement(out node);
            #if ENABLE_EXCEPTION_HANDLING
            } else if (la.kind == 54) {
            Imperative_ExceptionBlock(out node);
            #endif
            } else if (la.kind == 37) {
            Get();
            if (la.kind != _endline)
            SynErr("';' is expected.");

            Expect(20);
            node = new ProtoCore.AST.ImperativeAST.BreakNode(); NodeUtils.SetNodeLocation(node, t);
            } else if (la.kind == 38) {
            Get();
            if (la.kind != _endline)
               SynErr("';' is expected.");

            Expect(20);
            node = new ProtoCore.AST.ImperativeAST.ContinueNode(); NodeUtils.SetNodeLocation(node, t);
            } else if (IsAssignmentStatement() || IsVariableDeclaration()) {
            Imperative_assignstmt(out node);
            } else if (StartOf(4)) {
            Imperative_expr(out node);
            if (la.kind != _endline)
               SynErr("';' is expected.");

            Expect(20);
            } else if (la.kind == 20) {
            if (la.kind != _endline)
               SynErr("';' is expected.");

            Get();
            } else SynErr(103);
        }