X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fparser.mly;h=3a1712438ea132af989ef8ab2b3b727ba73e8e1c;hb=214f84c3b07227767fef90934895a167b15113a1;hp=f0580443abebd4fd66c71e8ccc375453dc00c805;hpb=7f776dee39a35732964a30091e55aa795169bca5;p=goals.git diff --git a/src/parser.mly b/src/parser.mly index f058044..3a17124 100644 --- a/src/parser.mly +++ b/src/parser.mly @@ -36,6 +36,7 @@ open Printf %token RIGHT_PAREN %token STRING %token TACTIC +%token TACTIC_KEYWORD (* Start nonterminals. *) %start file @@ -67,6 +68,10 @@ stmt: let name, params = $1 in name, Ast.EGoal ($loc, (params, [], [], Some $2)) } + | TACTIC_KEYWORD TACTIC params_decl EQUALS CODE + { + $2, Ast.ETactic ($loc, ($3, $5)) + } | LET ID EQUALS expr { $2, $4 } ; @@ -84,7 +89,7 @@ patterns: | separated_list(COMMA, pattern) { $1 } ; pattern: - | STRING { Ast.PTactic ($loc, "file", [$1]) } + | STRING { Ast.PTactic ($loc, "*file", [$1]) } | ID pattern_params { Ast.PTactic ($loc, $1, $2) } ; pattern_params: @@ -95,9 +100,9 @@ pattern_param: ; expr: - | ID params { Ast.ECall ($loc, $1, $2) } + | ID params { Ast.ECallGoal ($loc, $1, $2) } | ID { Ast.EVar ($loc, $1) } - | TACTIC params { Ast.ETactic ($loc, $1, $2) } + | TACTIC params { Ast.ECallTactic ($loc, $1, $2) } | STRING { Ast.ESubsts ($loc, $1) } | LEFT_ARRAY barelist RIGHT_ARRAY { Ast.EList ($loc, $2) } ;