Commit 00ba0830 authored by POTTIER Francois's avatar POTTIER Francois

New positive tests of attributes.

parent 728f80d4
Warning: 8 states have an end-of-stream conflict.
File "attributes-expansion.mly", line 13, characters 1-1:
Warning: production liste(C) -> is never reduced.
Warning: in total, 1 productions are never reduced.
%token A B C
%start<unit> main
%attribute liste(A) [@liste.A true]
%attribute liste [@happy true]
%%
main:
liste(A) liste(B) liste(C)
{}
liste [@liste true] (X):
x = X xs = liste(X) { x :: xs }
| { [] }
%start main
%token A
%token B
%token C
%type <unit> main
%%
main:
_1 = liste_A_ _2 = liste_B_ _3 = liste_C_
{ ()}
liste_A_ [@liste.A true] [@happy true] [@liste true]:
x = A xs = liste_A_
{ ( x :: xs )}
|
{ ( [] )}
liste_B_ [@happy true] [@liste true]:
x = B xs = liste_B_
{ ( x :: xs )}
|
{ ( [] )}
liste_C_ [@happy true] [@liste true]:
x = C xs = liste_C_
{ ( x :: xs )}
|
{ ( [] )}
%%
%token A [@a 0]
%token B [@b 0]
%token C [@c 0] [@d 1]
%attribute A B [@foo "foo"]
%attribute C [@bar "bar"] [@baz "baz"]
%attribute main [@main ()]
%[@claim "this is a grammar attribute"]
%start<unit> main
%%
main [@cost 0]:
A B [@producer true] C {}
%start main
%token A [@foo "foo"] [@a 0]
%token B [@foo "foo"] [@b 0]
%token C [@bar "bar"] [@baz "baz"] [@c 0] [@d 1]
%type <unit> main
%[@claim "this is a grammar attribute"]
%%
main [@main ()] [@cost 0]:
_1 = A _2 = B [@producer true] _3 = C
{ ()}
%%
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment