File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 - [ Extensions] ( lexextensions.md )
88 - [ Hand-written lexers] ( manuallexer.md )
99 - [ Start States] ( start_states.md )
10+ - [ Syntax] ( lexsyntax.md )
1011- [ Parsing] ( parsing.md )
1112 - [ Yacc compatibility] ( yacccompatibility.md )
1213 - [ Extensions] ( yaccextensions.md )
Original file line number Diff line number Diff line change 1+ The syntax of the lrlex ` .l ` format, aims to be familiar to the format used by posix lex.
2+ It uses the same basic structure as lex.
3+
4+ ```
5+ Definitions
6+ %%
7+ Rules
8+ %%
9+ UserSubroutines
10+ ```
11+
12+ ## Definitions
13+
14+ ### Optional %grmtools section
15+
16+ Defined in [ extensions] ( ./lexextensions.md )
17+
18+ ## Rules
19+
20+ Each rule is given by
21+
22+ ### Optional Start State
23+ Between angle brackets <Start_State>
24+
25+ ### Regex
26+
27+ Regular expressions are define by the rust [ regex] ( https://docs.rs/regex ) crate.
28+
29+
30+ ### Separator space
31+
32+ Any horizontal space character in the unicode ` Pattern_White_Space ` character set.
33+
34+ ### Optional State operator
35+
36+ Between angle brackets these are documented in [ Start States] ( ./start_states.md )
37+ * ` <+STATE> ` Push the state given by ` STATE ` to the top of the stack.
38+ * `<-STATE> Pop the state off the top of the stack.
39+ * ` <STATE> ` Replace the state stack with the state ` STATE `
40+
41+
42+ ### Token Name
43+
44+ Token name may contain any non-space character between double quotes, including double quotes
45+
46+ ### End of line
47+
48+ The end of line finishes a rule.
49+
50+ ## UserSubroutines
51+
52+ Since lrlex doesn't support user actions, it doesn't support User Subroutines either.
53+
You can’t perform that action at this time.
0 commit comments