symbolstartpos.opp.exp 794 Bytes
Newer Older
1
%start main
2
%token C
3 4 5 6 7 8 9
%token B
%token A

%type <unit> main
%%

main:
10 11 12 13 14 15
| _1 = A _2 = B _3 = hop
    {let _symbolstartpos = _startpos__1_ in
let _symbolstartofs = _symbolstartpos.Lexing.pos_cnum in
              ( _symbolstartpos, _symbolstartofs )}

hop:
16 17 18
| _1 = nothing _2 = bar _3 = A _4 = B
    {let _symbolstartpos = _startpos__2_ in
                     ( _symbolstartpos )}
19 20 21 22

bar:
| _1 = option_foo_ _2 = B
    {let _symbolstartpos = if Pervasives.(!=) _startpos__1_ _endpos__1_ then
23 24
  _startpos__1_
else
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
  _startpos__2_ in
            ( _symbolstartpos )}

foo:
| _1 = C _2 = nothing
    {               ()}

nothing:
| 
    {let _endpos = _endpos__0_ in
let _symbolstartpos = _endpos in
         ( _symbolstartpos )}

option_foo_:
| 
    {    ( None )}
| x = foo
    {    ( Some x )}
43 44 45 46 47

%%