[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: api.location.type is unsupported for C parsers

From: Akim Demaille
Subject: Re: api.location.type is unsupported for C parsers
Date: Thu, 25 Apr 2019 18:13:40 +0200

Hi Balázs!

> Le 25 avr. 2019 à 07:03, Scheidler, Balázs <address@hidden> a écrit :
> I've tried this now and api.location.type does seem to work.

That's good to know, I'll install that patch in master.

> I still have some other compilation issues to hunt. One of those is on  "enum 
> XXX_tokentype". Since I am using the same tokens in multiple grammars, I get 
> duplications.

Doh.  That one is a tricky one :(

> modules/native/native-grammar.c:279:25: error: expected identifier before 
> numeric constant
>  #define LL_CONTEXT_ROOT 1
>                          ^
> lib/cfg-grammar.h:107:5: note: in expansion of macro ‘LL_CONTEXT_ROOT’
>      LL_CONTEXT_ROOT = 1,
>      ^~~~~~~~~~~~~~~
> The native-grammar file is a "slave" grammar that reuses some of the tokens 
> of the main one. cfg-grammar.h is the main grammar. At the end both grammars 
> have overlapping "tokens", but then the 2nd includes the header of the first. 
> I am not sure how to resolve this yet, but I'll look at it in the coming days.

What is really specific here is that I suppose that you do use a single scanner 
for all the grammars, right?  So do want to use the same names in every parser, 

If you want the tokens to be disjoint, that's really easy: use different values 
of api.token.prefix.  But here you want token types that are different but 
compatible, right?

Can you tell me more about how you deal with the different scanners?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]