c - Lexical Tie-Ins with Flex and Bison -
I want to identify the language that does not conform to the normal flex / bisan paradigm. Based on the meaning context it has completely different token rules, for example:
main () {batchblocks {echo hello world! Set backing = some echo% batchvar%}}
Biosan apparently supports the recognition of these types of grammar, but it is necessary "" to effectively support them. It provides an interface to do this - but I'm confused as to how I can supply different flex regazes based on context - if this is also possible.
Thank you in advance :)
I am confused as to the context Based on how many exact flex regexes can I supply
Flex has a state mechanism under which you can switch it between different sets. For this, after the << p>
% x name_of_state
<< code>%} at the top of the syntax file is more in your matching Rule (after the first %%
)
& lt; Name_of_state & gt; * Regex goes here *
Then it regex matches only if that condition is there.
There is more than one way to change the states. This is also a global state and <; For example, if you want to keep a heap of states, then
yy_pop_state
and yy_push_state
can alternatively use BEGIN_ (name_of_state)
To return to the initial state, use BEGIN (INITIAL)
.
Comments
Post a Comment