Skip to content

Commit 5194d36

Browse files
committed
switch to using itemized lists
1 parent a94697f commit 5194d36

1 file changed

Lines changed: 15 additions & 35 deletions

File tree

doc/src/lexsyntax.md

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,28 @@ Definitions
66
%%
77
Rules
88
%%
9-
UserSubroutines
9+
User Subroutines
1010
```
1111

1212
## Definitions
1313

14-
### Optional %grmtools section
15-
16-
Defined in [extensions](./lexextensions.md)
14+
Within the definitions section, you can add an option `%grmtools` section
15+
documented in [extensions](./lexextensions.md)
1716

1817
## Rules
1918

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.
19+
Each rule is given by the following elements in sequence:
4920

50-
## UserSubroutines
21+
1. Optional Start State, a name given between angle brackets for example `<Start_State>` documented in [Start States](./start_states.md)
22+
2. Regex, syntax defined by the rust [regex](https://docs.rs/regex) crate with optional escaping for any character.
23+
3. Separator space, any horizontal space character in the unicode `Pattern_White_Space` character set
24+
4. Optional State operator, given between angle brackets documented in [Start States](./start_states.md)
25+
+ `<+STATE>` Push the state given by `STATE` to the top of the stack.
26+
+ `<-STATE>` Pop the state off the top of the stack.
27+
+ `<STATE>` Replace the state stack with the state `STATE`
28+
5. Token Name, for example `"token"` any non-space character between double quotes, including double quotes.
29+
6. End of line, finishes each rule.
5130

52-
Since lrlex doesn't support user actions, it doesn't support User Subroutines either.
31+
## User Subroutines
5332

33+
Since lrlex doesn't support user actions, it doesn't support User Subroutines either.

0 commit comments

Comments
 (0)