예제 #1
0
파일: parser.py 프로젝트: W-M-T/gsc
def ActStmt():
    found_val = yield Ass ^ FunCall
    return AST.ACTSTMT(val=found_val)
예제 #2
0
 type=AST.FUNTYPE(
     from_types=[
         AST.TYPE(val=AST.BASICTYPE(type_id=Token(
             None, TOKEN.TYPE_IDENTIFIER, "Char")))
     ],
     to_type=AST.TYPE(val=AST.BASICTYPE(
         type_id=Token(None, TOKEN.TYPE_IDENTIFIER, "Char")))),
 vardecls=[],
 stmts=[
     AST.STMT(val=AST.RETURN(expr=None)),
     AST.STMT(val=AST.RETURN(expr=None)),
     AST.LOOP(
         init=AST.ACTSTMT(val=AST.ASSIGNMENT(
             varref=AST.VARREF(id=Token(None, TOKEN.IDENTIFIER,
                                        "x"),
                               fields=[]),
             expr=AST.DEFERREDEXPR(
                 contents=[Token(None, TOKEN.IDENTIFIER, "x")
                           ]))),
         cond=AST.DEFERREDEXPR(contents=[
             Token(None, TOKEN.IDENTIFIER, "x"),
             Token(None, TOKEN.OP_IDENTIFIER, "=="),
             Token(None, TOKEN.IDENTIFIER, "y")
         ]),
         update=AST.FUNCALL(id=Token(None, TOKEN.IDENTIFIER,
                                     "f"),
                            kind=FunKind.FUNC,
                            args=[]),
         stmts=[
             AST.STMT(
                 val=AST.RETURN(expr=None)),