I’m puzzled. I have the same rules in two grammars one parse a sequence and
the other not.
self parse: ‘payable internal'
_FunctionTypeNameOptions
:
| FunctionTypeNameOptions
;
FunctionTypeNameOptions
: FunctionTypeNameOption 'option' {{}}
| FunctionTypeNameOptions FunctionTypeNameOption 'option'
I’m puzzled. I have the same rules in two grammars one parse a sequence and
the other not.
self parse: ‘payable internal'
_FunctionTypeNameOptions
:
| FunctionTypeNameOptions
;
FunctionTypeNameOptions
: FunctionTypeNameOption 'option' {{}}
| FunctionTypeNameOptions FunctionTypeNameOption
Le 27/03/2017 à 21:12, Stephane Ducasse a écrit :
what was strange is that this version
: \s+;
%root MultiListObject;
%prefix XPML;
modifiers_opt
:
| modifiers
;
modifiers
: modifier 'modifier' {{}}
| modifiers modifier 'modifier' {{}}
;
modifier
: "public" 'token' {{Modifier}}
| "protected" '
what was strange is that this version
: \s+;
%root MultiListObject;
%prefix XPML;
modifiers_opt
:
| modifiers
;
modifiers
: modifier 'modifier' {{}}
| modifiers modifier 'modifier' {{}}
;
modifier
: "public" 'token' {{Modifier}}
| "protected" 'token' {{Modifier}}
| "private" 'token' {{Modifier}}
Hi Stéphane,
can you send the complete grammar? The %root directive should have no
impact on parse failures.
Thierry
Le 27/03/2017 à 18:40, Stephane Ducasse a écrit :
Apparently there is an interaction with the root directives.
On Mon, Mar 27, 2017 at 6:34 PM, Stephane Ducasse
mailto:stepha
Apparently there is an interaction with the root directives.
On Mon, Mar 27, 2017 at 6:34 PM, Stephane Ducasse
wrote:
> Now I tried to hook modifier logic to test and I cannot have two modifiers.
> I thought that
>
> modifiers
> : modifier 'modifier'
> | modifiers modifier 'modifier'
> ;
> allow
Now I tried to hook modifier logic to test and I cannot have two modifiers.
I thought that
modifiers
: modifier 'modifier'
| modifiers modifier 'modifier'
;
allows one to have 'public static' but apparently not so I'm totally
confused.
On Mon, Mar 27, 2017 at 6:30 PM, Stephane Ducasse
wrote:
>
Hi john
I'm learning smacc as a challenge :) I read a review the tutorial that we
extracted form your doc.
I have the following expression
FunctionTypeName = 'function' TypeNameList ( 'internal' | 'external' |
'constant' | 'payable' )* ( 'returns' TypeNameList )?
and I started to handle the 'in