首页 > 其他分享 >一键生成`Scope`文法解析器

一键生成`Scope`文法解析器

时间:2023-05-13 19:24:29浏览次数:35  
标签:解析器 -- 一键 RangeItems char _- Scope RangeItem

Compiler of Scope

The C# source code of the compiler Scope is generated by bitzhuwei.GrammarFormat.

Grammar

// 7 VnRegulations:
Scope : '[' 'firstItem1' RangeItems ']' // [0]
      | '[^' 'firstItem2' RangeItems ']' // [1]
      | '[' 'firstItem1' ']' // [2]
      | '[^' 'firstItem2' ']' ; // [3]
RangeItems : RangeItems RangeItem // [4]
           | RangeItem ; // [5]
RangeItem : 'char' ; // [6]
// 3 VtPatterns:
'firstItem1' : %%<'['>\\u[0-9]{4}|\\t|\\n|\\r|\\-|[ -Z]|\[|\\\\|]|\\\^|[_-~]%% ; // [0]
'firstItem2' : %%<'[^'>\\u[0-9]{4}|\\t|\\n|\\r|\\-|[ -Z]|\[|\\\\|]|\^|\\\^|[_-~]%% ; // [1]
'char' : %%\\u[0-9]{4}|\\t|\\n|\\r|\\-|[ -Z]|\\\[|\\\\|\\\]|\^|\\\^|[_-~]%% ; // [2]

Lexical Analyzer States

flowchart classDef c0001 color:#FF0000; classDef c0010 stroke-dasharray: 10 10; classDef c0011 stroke-dasharray: 10 10,color:#FF0000; classDef c0100 fill:#BB66EE; classDef c0101 fill:#BB66EE,color:#FF0000; classDef c0110 fill:#BB66EE,stroke-dasharray: 10 10; classDef c0111 fill:#BB66EE,stroke-dasharray: 10 10,color:#FF0000; classDef c1000 stroke:#333,stroke-width:4px; classDef c1001 stroke:#333,stroke-width:4px,color:#FF0000; classDef c1010 stroke:#333,stroke-width:4px,stroke-dasharray: 10 10; classDef c1011 stroke:#333,stroke-width:4px,stroke-dasharray: 10 10,color:#FF0000; classDef c1100 stroke:#333,stroke-width:4px,fill:#BB66EE; classDef c1101 stroke:#333,stroke-width:4px,fill:#BB66EE,color:#FF0000; classDef c1110 stroke:#333,stroke-width:4px,fill:#BB66EE,stroke-dasharray: 10 10; classDef c1111 stroke:#333,stroke-width:4px,fill:#BB66EE,stroke-dasharray: 10 10,color:#FF0000; DFA0_178694530{{"DFA0 wholeStart"}} class DFA0_178694530 c1000; DFA1_-772889398{{"DFA1 {9}"}} DFA2_-183236595[\"DFA2 {1}"/] class DFA2_-183236595 c0101; DFA3_987753403[\"DFA3 {1}"/] class DFA3_987753403 c0101; DFA4_-678760965[\"DFA4 {1}"/] class DFA4_-678760965 c0101; DFA5_-55324813[\"DFA5 {2}"/] class DFA5_-55324813 c1101; DFA6_1405897005[\"DFA6 {1}"/] class DFA6_1405897005 c0101; DFA7_-526014914{{"DFA7 {1}"}} DFA8_-77729058[\"DFA8 {1}"/] class DFA8_-77729058 c0101; DFA9_-1969299243[\"DFA9 {1}"/] class DFA9_-1969299243 c0101; DFA10_1210241937[\"DFA10 {1}"/] class DFA10_1210241937 c0101; DFA11_757152697[\"DFA11 {1}"/] class DFA11_757152697 c0101; DFA12_-598210763[\"DFA12 {1}"/] class DFA12_-598210763 c0101; DFA13_288695511[\"DFA13 {1}"/] class DFA13_288695511 c0101; DFA14_1527739253[\"DFA14 {1}"/] class DFA14_1527739253 c0101; DFA15_690638386[\"DFA15 {1}"/] class DFA15_690638386 c0101; DFA16_695270034{{"DFA16 {7}"}} DFA17_-1125009235[\"DFA17 {1}"/] class DFA17_-1125009235 c0101; DFA18_-1824766574[\"DFA18 {1}"/] class DFA18_-1824766574 c0101; DFA19_-346729537[\"DFA19 {1}"/] class DFA19_-346729537 c0101; DFA20_832646392[\"DFA20 {1}"/] class DFA20_832646392 c0101; DFA21_348735340[\"DFA21 {1}"/] class DFA21_348735340 c1101; DFA22_1623355910{{"DFA22 {1}"}} DFA23_-966956886{{"DFA23 {1}"}} DFA24_-1306082567[\"DFA24 {1}"/] class DFA24_-1306082567 c0101; DFA25_-1931548102[\"DFA25 {1}"/] class DFA25_-1931548102 c0101; DFA26_481872213[\"DFA26 {1}"/] class DFA26_481872213 c0101; DFA27_-113939776[\"DFA27 {1}"/] class DFA27_-113939776 c0101; DFA28_1197184386[\"DFA28 {1}"/] class DFA28_1197184386 c0101; DFA29_1158683928[\"DFA29 {1}"/] class DFA29_1158683928 c0101; DFA30_1122838131{{"DFA30 {7}"}} DFA31_-380737881[\"DFA31 {1}"/] class DFA31_-380737881 c0101; DFA32_1297990935[\"DFA32 {1}"/] class DFA32_1297990935 c0101; DFA33_314935890[\"DFA33 {1}"/] class DFA33_314935890 c0101; DFA34_656572424[\"DFA34 {1}"/] class DFA34_656572424 c0101; DFA35_-1581529229[\"DFA35 {1}"/] class DFA35_-1581529229 c0101; DFA36_88598524{{"DFA36 {1}"}} DFA37_-697564398{{"DFA37 {1}"}} DFA38_1602077691{{"DFA38 {1}"}} DFA39_-1400035845[\"DFA39 {1}"/] class DFA39_-1400035845 c0101; DFA40_-309823494[\"DFA40 {1}"/] class DFA40_-309823494 c0101; DFA41_-1920122602[\"DFA41 {1}"/] class DFA41_-1920122602 c0101; DFA42_-367677254[\"DFA42 {1}"/] class DFA42_-367677254 c0101; DFA43_-24807432[\"DFA43 {1}"/] class DFA43_-24807432 c0101; DFA44_533188336[\"DFA44 {1}"/] class DFA44_533188336 c0101; DFA45_-1262852157{{"DFA45 {1}"}} DFA46_-428432942{{"DFA46 {1}"}} DFA47_-1789142534{{"DFA47 {1}"}} DFA48_334064317[\"DFA48 {1}"/] class DFA48_334064317 c0101; DFA49_-2137454313{{"DFA49 {1}"}} DFA50_1290846263{{"DFA50 {1}"}} DFA51_-851077430[\"DFA51 {1}"/] class DFA51_-851077430 c0101; DFA52_-1969594929{{"DFA52 {1}"}} DFA53_1051069287[\"DFA53 {1}"/] class DFA53_1051069287 c0101; DFA0_178694530 -->|"#92; BeginToken 'char'"|DFA1_-772889398 DFA0_178694530 -->|"[#32;-Z] BeginToken 'char' ExtendToken 'char'"|DFA2_-183236595 DFA0_178694530 -->|"^ BeginToken 'char' ExtendToken 'char'"|DFA3_987753403 DFA0_178694530 -->|"[_-~] BeginToken 'char' ExtendToken 'char'"|DFA4_-678760965 DFA0_178694530 -->|"[ BeginToken '[''[^' ExtendToken '['"|DFA5_-55324813 DFA0_178694530 -->|"] BeginToken ']' ExtendToken ']'"|DFA6_1405897005 DFA1_-772889398 -->|"u"|DFA7_-526014914 DFA1_-772889398 -->|"t ExtendToken 'char'"|DFA8_-77729058 DFA1_-772889398 -->|"n ExtendToken 'char'"|DFA9_-1969299243 DFA1_-772889398 -->|"r ExtendToken 'char'"|DFA10_1210241937 DFA1_-772889398 -->|"- ExtendToken 'char'"|DFA11_757152697 DFA1_-772889398 -->|"[ ExtendToken 'char'"|DFA12_-598210763 DFA1_-772889398 -->|"#92; ExtendToken 'char'"|DFA13_288695511 DFA1_-772889398 -->|"] ExtendToken 'char'"|DFA14_1527739253 DFA1_-772889398 -->|"^ ExtendToken 'char'"|DFA15_690638386 DFA5_-55324813 -->|"#92; AcceptPrevious '[' BeginToken 'firstItem1'"|DFA16_695270034 DFA5_-55324813 -->|"[#32;-Z] AcceptPrevious '[' BeginToken 'firstItem1' ExtendToken 'firstItem1'"|DFA17_-1125009235 DFA5_-55324813 -->|"[ AcceptPrevious '[' BeginToken 'firstItem1' ExtendToken 'firstItem1'"|DFA18_-1824766574 DFA5_-55324813 -->|"] AcceptPrevious '[' BeginToken 'firstItem1' ExtendToken 'firstItem1'"|DFA19_-346729537 DFA5_-55324813 -->|"[_-~] AcceptPrevious '[' BeginToken 'firstItem1' ExtendToken 'firstItem1'"|DFA20_832646392 DFA5_-55324813 -->|"^ ExtendToken '[^'"|DFA21_348735340 DFA7_-526014914 -->|"[0-9]"|DFA22_1623355910 DFA16_695270034 -->|"u"|DFA23_-966956886 DFA16_695270034 -->|"t ExtendToken 'firstItem1'"|DFA24_-1306082567 DFA16_695270034 -->|"n ExtendToken 'firstItem1'"|DFA25_-1931548102 DFA16_695270034 -->|"r ExtendToken 'firstItem1'"|DFA26_481872213 DFA16_695270034 -->|"- ExtendToken 'firstItem1'"|DFA27_-113939776 DFA16_695270034 -->|"#92; ExtendToken 'firstItem1'"|DFA28_1197184386 DFA16_695270034 -->|"^ ExtendToken 'firstItem1'"|DFA29_1158683928 DFA21_348735340 -->|"#92; AcceptPrevious '[^' BeginToken 'firstItem2'"|DFA30_1122838131 DFA21_348735340 -->|"[#32;-Z] AcceptPrevious '[^' BeginToken 'firstItem2' ExtendToken 'firstItem2'"|DFA31_-380737881 DFA21_348735340 -->|"[ AcceptPrevious '[^' BeginToken 'firstItem2' ExtendToken 'firstItem2'"|DFA32_1297990935 DFA21_348735340 -->|"] AcceptPrevious '[^' BeginToken 'firstItem2' ExtendToken 'firstItem2'"|DFA33_314935890 DFA21_348735340 -->|"^ AcceptPrevious '[^' BeginToken 'firstItem2' ExtendToken 'firstItem2'"|DFA34_656572424 DFA21_348735340 -->|"[_-~] AcceptPrevious '[^' BeginToken 'firstItem2' ExtendToken 'firstItem2'"|DFA35_-1581529229 DFA22_1623355910 -->|"[0-9]"|DFA36_88598524 DFA23_-966956886 -->|"[0-9]"|DFA37_-697564398 DFA30_1122838131 -->|"u"|DFA38_1602077691 DFA30_1122838131 -->|"t ExtendToken 'firstItem2'"|DFA39_-1400035845 DFA30_1122838131 -->|"n ExtendToken 'firstItem2'"|DFA40_-309823494 DFA30_1122838131 -->|"r ExtendToken 'firstItem2'"|DFA41_-1920122602 DFA30_1122838131 -->|"- ExtendToken 'firstItem2'"|DFA42_-367677254 DFA30_1122838131 -->|"#92; ExtendToken 'firstItem2'"|DFA43_-24807432 DFA30_1122838131 -->|"^ ExtendToken 'firstItem2'"|DFA44_533188336 DFA36_88598524 -->|"[0-9]"|DFA45_-1262852157 DFA37_-697564398 -->|"[0-9]"|DFA46_-428432942 DFA38_1602077691 -->|"[0-9]"|DFA47_-1789142534 DFA45_-1262852157 -->|"[0-9] ExtendToken 'char'"|DFA48_334064317 DFA46_-428432942 -->|"[0-9]"|DFA49_-2137454313 DFA47_-1789142534 -->|"[0-9]"|DFA50_1290846263 DFA49_-2137454313 -->|"[0-9] ExtendToken 'firstItem1'"|DFA51_-851077430 DFA50_1290846263 -->|"[0-9]"|DFA52_-1969594929 DFA52_-1969594929 -->|"[0-9] ExtendToken 'firstItem2'"|DFA53_1051069287

FIRST

[0]: FIRST( Scope ) = { '[' '[^' }
[1]: FIRST( RangeItems ) = { 'char' }
[2]: FIRST( RangeItem ) = { 'char' }
[3]: FIRST( '[' ) = { '[' }
[4]: FIRST( 'firstItem1' ) = { 'firstItem1' }
[5]: FIRST( ']' ) = { ']' }
[6]: FIRST( '[^' ) = { '[^' }
[7]: FIRST( 'firstItem2' ) = { 'firstItem2' }
[8]: FIRST( 'char' ) = { 'char' }
[9]: FIRST(  ) = { empty }
[10]: FIRST( '[' 'firstItem1' RangeItems ']' ) = { '[' }
[11]: FIRST( '[^' 'firstItem2' RangeItems ']' ) = { '[^' }
[12]: FIRST( '[' 'firstItem1' ']' ) = { '[' }
[13]: FIRST( '[^' 'firstItem2' ']' ) = { '[^' }
[14]: FIRST( RangeItems RangeItem ) = { 'char' }

FOLLOW

[0]: FOLLOW( Scope ) = { }
[1]: FOLLOW( RangeItems ) = { ']' 'char' }
[2]: FOLLOW( RangeItem ) = { ']' 'char' }

LL(1) Syntax Machine

状态 '[' 'firstItem1' ']' '[^' 'firstItem2' 'char'
Scope R[0] R[2] R[1] R[3]
RangeItems R[4] R[5]
RangeItem R[6]

LR(0) Syntax Machine

状态 '[' 'firstItem1' ']' '[^' 'firstItem2' 'char' '¥' Scope RangeItems RangeItem
0 S2 S3 G1
1 完成
2 S4
3 S5
4 S7 S9 G6 G8
5 S11 S9 G10 G8
6 S12 S9 G13
7 R[2] R[2] R[2] R[2] R[2] R[2] R[2]
8 R[5] R[5] R[5] R[5] R[5] R[5] R[5]
9 R[6] R[6] R[6] R[6] R[6] R[6] R[6]
10 S14 S9 G13
11 R[3] R[3] R[3] R[3] R[3] R[3] R[3]
12 R[0] R[0] R[0] R[0] R[0] R[0] R[0]
13 R[4] R[4] R[4] R[4] R[4] R[4] R[4]
14 R[1] R[1] R[1] R[1] R[1] R[1] R[1]
flowchart classDef default fill:#C7EDCC,stroke:#993399,stroke-width:0px,text-align:left; classDef titlebarStyle fill:gold; titlebar>"LR(1) syntax states"] class titlebar titlebarStyle syntaxState0("syntaxState0 [-1] ResolvedScope> : ⏳ Scope ; [0] Scope : ⏳ '[' 'firstItem1' RangeItems ']' ; [1] Scope : ⏳ '[^' 'firstItem2' RangeItems ']' ; [2] Scope : ⏳ '[' 'firstItem1' ']' ; [3] Scope : ⏳ '[^' 'firstItem2' ']' ; ") syntaxState1("syntaxState1 [-1] ResolvedScope> : Scope ⏳ ; ") syntaxState2("syntaxState2 [0] Scope : '[' ⏳ 'firstItem1' RangeItems ']' ; [2] Scope : '[' ⏳ 'firstItem1' ']' ; ") syntaxState3("syntaxState3 [1] Scope : '[^' ⏳ 'firstItem2' RangeItems ']' ; [3] Scope : '[^' ⏳ 'firstItem2' ']' ; ") syntaxState4("syntaxState4 [0] Scope : '[' 'firstItem1' ⏳ RangeItems ']' ; [2] Scope : '[' 'firstItem1' ⏳ ']' ; [4] RangeItems : ⏳ RangeItems RangeItem ; [5] RangeItems : ⏳ RangeItem ; [6] RangeItem : ⏳ 'char' ; ") syntaxState5("syntaxState5 [1] Scope : '[^' 'firstItem2' ⏳ RangeItems ']' ; [3] Scope : '[^' 'firstItem2' ⏳ ']' ; [4] RangeItems : ⏳ RangeItems RangeItem ; [5] RangeItems : ⏳ RangeItem ; [6] RangeItem : ⏳ 'char' ; ") syntaxState6("syntaxState6 [0] Scope : '[' 'firstItem1' RangeItems ⏳ ']' ; [4] RangeItems : RangeItems ⏳ RangeItem ; [6] RangeItem : ⏳ 'char' ; ") syntaxState7("syntaxState7 [2] Scope : '[' 'firstItem1' ']' ⏳ ; ") syntaxState8("syntaxState8 [5] RangeItems : RangeItem ⏳ ; ") syntaxState9("syntaxState9 [6] RangeItem : 'char' ⏳ ; ") syntaxState10("syntaxState10 [1] Scope : '[^' 'firstItem2' RangeItems ⏳ ']' ; [4] RangeItems : RangeItems ⏳ RangeItem ; [6] RangeItem : ⏳ 'char' ; ") syntaxState11("syntaxState11 [3] Scope : '[^' 'firstItem2' ']' ⏳ ; ") syntaxState12("syntaxState12 [0] Scope : '[' 'firstItem1' RangeItems ']' ⏳ ; ") syntaxState13("syntaxState13 [4] RangeItems : RangeItems RangeItem ⏳ ; ") syntaxState14("syntaxState14 [1] Scope : '[^' 'firstItem2' RangeItems ']' ⏳ ; ") syntaxState0 -.-> |"Scope"| syntaxState1 syntaxState0 --> |"'['"| syntaxState2 syntaxState0 --> |"'[^'"| syntaxState3 syntaxState2 --> |"'firstItem1'"| syntaxState4 syntaxState3 --> |"'firstItem2'"| syntaxState5 syntaxState4 -.-> |"RangeItems"| syntaxState6 syntaxState4 --> |"']'"| syntaxState7 syntaxState4 -.-> |"RangeItem"| syntaxState8 syntaxState4 --> |"'char'"| syntaxState9 syntaxState5 -.-> |"RangeItems"| syntaxState10 syntaxState5 --> |"']'"| syntaxState11 syntaxState5 -.-> |"RangeItem"| syntaxState8 syntaxState5 --> |"'char'"| syntaxState9 syntaxState6 --> |"']'"| syntaxState12 syntaxState6 -.-> |"RangeItem"| syntaxState13 syntaxState6 --> |"'char'"| syntaxState9 syntaxState10 --> |"']'"| syntaxState14 syntaxState10 -.-> |"RangeItem"| syntaxState13 syntaxState10 --> |"'char'"| syntaxState9 syntaxState1 o--o |"'¥'"| syntaxState1 syntaxState7 x==x |"'[' 'firstItem1' ']' '[^' 'firstItem2' 'char' '¥' R[2]= Scope : '[' 'firstItem1' ']' ;"| syntaxState7 syntaxState8 x==x |"'[' 'firstItem1' ']' '[^' 'firstItem2' 'char' '¥' R[5]= RangeItems : RangeItem ;"| syntaxState8 syntaxState9 x==x |"'[' 'firstItem1' ']' '[^' 'firstItem2' 'char' '¥' R[6]= RangeItem : 'char' ;"| syntaxState9 syntaxState11 x==x |"'[' 'firstItem1' ']' '[^' 'firstItem2' 'char' '¥' R[3]= Scope : '[^' 'firstItem2' ']' ;"| syntaxState11 syntaxState12 x==x |"'[' 'firstItem1' ']' '[^' 'firstItem2' 'char' '¥' R[0]= Scope : '[' 'firstItem1' RangeItems ']' ;"| syntaxState12 syntaxState13 x==x |"'[' 'firstItem1' ']' '[^' 'firstItem2' 'char' '¥' R[4]= RangeItems : RangeItems RangeItem ;"| syntaxState13 syntaxState14 x==x |"'[' 'firstItem1' ']' '[^' 'firstItem2' 'char' '¥' R[1]= Scope : '[^' 'firstItem2' RangeItems ']' ;"| syntaxState14

SLR(1) Syntax Machine

状态 '[' 'firstItem1' ']' '[^' 'firstItem2' 'char' '¥' Scope RangeItems RangeItem
0 S2 S3 G1
1 完成
2 S4
3 S5
4 S7 S9 G6 G8
5 S11 S9 G10 G8
6 S12 S9 G13
7 R[2]
8 R[5] R[5]
9 R[6] R[6]
10 S14 S9 G13
11 R[3]
12 R[0]
13 R[4] R[4]
14 R[1]
flowchart classDef default fill:#C7EDCC,stroke:#993399,stroke-width:0px,text-align:left; classDef titlebarStyle fill:gold; titlebar>"LR(1) syntax states"] class titlebar titlebarStyle syntaxState0("syntaxState0 [-1] ResolvedScope> : ⏳ Scope ; [0] Scope : ⏳ '[' 'firstItem1' RangeItems ']' ; [1] Scope : ⏳ '[^' 'firstItem2' RangeItems ']' ; [2] Scope : ⏳ '[' 'firstItem1' ']' ; [3] Scope : ⏳ '[^' 'firstItem2' ']' ; ") syntaxState1("syntaxState1 [-1] ResolvedScope> : Scope ⏳ ; ") syntaxState2("syntaxState2 [0] Scope : '[' ⏳ 'firstItem1' RangeItems ']' ; [2] Scope : '[' ⏳ 'firstItem1' ']' ; ") syntaxState3("syntaxState3 [1] Scope : '[^' ⏳ 'firstItem2' RangeItems ']' ; [3] Scope : '[^' ⏳ 'firstItem2' ']' ; ") syntaxState4("syntaxState4 [0] Scope : '[' 'firstItem1' ⏳ RangeItems ']' ; [2] Scope : '[' 'firstItem1' ⏳ ']' ; [4] RangeItems : ⏳ RangeItems RangeItem ; [5] RangeItems : ⏳ RangeItem ; [6] RangeItem : ⏳ 'char' ; ") syntaxState5("syntaxState5 [1] Scope : '[^' 'firstItem2' ⏳ RangeItems ']' ; [3] Scope : '[^' 'firstItem2' ⏳ ']' ; [4] RangeItems : ⏳ RangeItems RangeItem ; [5] RangeItems : ⏳ RangeItem ; [6] RangeItem : ⏳ 'char' ; ") syntaxState6("syntaxState6 [0] Scope : '[' 'firstItem1' RangeItems ⏳ ']' ; [4] RangeItems : RangeItems ⏳ RangeItem ; [6] RangeItem : ⏳ 'char' ; ") syntaxState7("syntaxState7 [2] Scope : '[' 'firstItem1' ']' ⏳ ; ") syntaxState8("syntaxState8 [5] RangeItems : RangeItem ⏳ ; ") syntaxState9("syntaxState9 [6] RangeItem : 'char' ⏳ ; ") syntaxState10("syntaxState10 [1] Scope : '[^' 'firstItem2' RangeItems ⏳ ']' ; [4] RangeItems : RangeItems ⏳ RangeItem ; [6] RangeItem : ⏳ 'char' ; ") syntaxState11("syntaxState11 [3] Scope : '[^' 'firstItem2' ']' ⏳ ; ") syntaxState12("syntaxState12 [0] Scope : '[' 'firstItem1' RangeItems ']' ⏳ ; ") syntaxState13("syntaxState13 [4] RangeItems : RangeItems RangeItem ⏳ ; ") syntaxState14("syntaxState14 [1] Scope : '[^' 'firstItem2' RangeItems ']' ⏳ ; ") syntaxState0 -.-> |"Scope"| syntaxState1 syntaxState0 --> |"'['"| syntaxState2 syntaxState0 --> |"'[^'"| syntaxState3 syntaxState2 --> |"'firstItem1'"| syntaxState4 syntaxState3 --> |"'firstItem2'"| syntaxState5 syntaxState4 -.-> |"RangeItems"| syntaxState6 syntaxState4 --> |"']'"| syntaxState7 syntaxState4 -.-> |"RangeItem"| syntaxState8 syntaxState4 --> |"'char'"| syntaxState9 syntaxState5 -.-> |"RangeItems"| syntaxState10 syntaxState5 --> |"']'"| syntaxState11 syntaxState5 -.-> |"RangeItem"| syntaxState8 syntaxState5 --> |"'char'"| syntaxState9 syntaxState6 --> |"']'"| syntaxState12 syntaxState6 -.-> |"RangeItem"| syntaxState13 syntaxState6 --> |"'char'"| syntaxState9 syntaxState10 --> |"']'"| syntaxState14 syntaxState10 -.-> |"RangeItem"| syntaxState13 syntaxState10 --> |"'char'"| syntaxState9 syntaxState1 o--o |"'¥'"| syntaxState1 syntaxState7 x==x |"'¥' R[2]= Scope : '[' 'firstItem1' ']' ;"| syntaxState7 syntaxState8 x==x |"']' 'char' R[5]= RangeItems : RangeItem ;"| syntaxState8 syntaxState9 x==x |"']' 'char' R[6]= RangeItem : 'char' ;"| syntaxState9 syntaxState11 x==x |"'¥' R[3]= Scope : '[^' 'firstItem2' ']' ;"| syntaxState11 syntaxState12 x==x |"'¥' R[0]= Scope : '[' 'firstItem1' RangeItems ']' ;"| syntaxState12 syntaxState13 x==x |"']' 'char' R[4]= RangeItems : RangeItems RangeItem ;"| syntaxState13 syntaxState14 x==x |"'¥' R[1]= Scope : '[^' 'firstItem2' RangeItems ']' ;"| syntaxState14

LALR(1) Syntax Machine

状态 '[' 'firstItem1' ']' '[^' 'firstItem2' 'char' '¥' Scope RangeItems RangeItem
0 S2 S3 G1
1 完成
2 S4
3 S5
4 S7 S9 G6 G8
5 S11 S9 G10 G8
6 S12 S9 G13
7 R[2]
8 R[5] R[5]
9 R[6] R[6]
10 S14 S9 G13
11 R[3]
12 R[0]
13 R[4] R[4]
14 R[1]
flowchart classDef default fill:#C7EDCC,stroke:#993399,stroke-width:0px,text-align:left; classDef titlebarStyle fill:gold; titlebar>"LR(1) syntax states"] class titlebar titlebarStyle syntaxState0("syntaxState0 [-1] ResolvedScope> : ⏳ Scope ; '¥' [0] Scope : ⏳ '[' 'firstItem1' RangeItems ']' ; '¥' [1] Scope : ⏳ '[^' 'firstItem2' RangeItems ']' ; '¥' [2] Scope : ⏳ '[' 'firstItem1' ']' ; '¥' [3] Scope : ⏳ '[^' 'firstItem2' ']' ; '¥' ") syntaxState1("syntaxState1 [-1] ResolvedScope> : Scope ⏳ ; '¥' ") syntaxState2("syntaxState2 [0] Scope : '[' ⏳ 'firstItem1' RangeItems ']' ; '¥' [2] Scope : '[' ⏳ 'firstItem1' ']' ; '¥' ") syntaxState3("syntaxState3 [1] Scope : '[^' ⏳ 'firstItem2' RangeItems ']' ; '¥' [3] Scope : '[^' ⏳ 'firstItem2' ']' ; '¥' ") syntaxState4("syntaxState4 [0] Scope : '[' 'firstItem1' ⏳ RangeItems ']' ; '¥' [2] Scope : '[' 'firstItem1' ⏳ ']' ; '¥' [4] RangeItems : ⏳ RangeItems RangeItem ; ']' 'char' [5] RangeItems : ⏳ RangeItem ; ']' 'char' [6] RangeItem : ⏳ 'char' ; ']' 'char' ") syntaxState5("syntaxState5 [1] Scope : '[^' 'firstItem2' ⏳ RangeItems ']' ; '¥' [3] Scope : '[^' 'firstItem2' ⏳ ']' ; '¥' [4] RangeItems : ⏳ RangeItems RangeItem ; ']' 'char' [5] RangeItems : ⏳ RangeItem ; ']' 'char' [6] RangeItem : ⏳ 'char' ; ']' 'char' ") syntaxState6("syntaxState6 [0] Scope : '[' 'firstItem1' RangeItems ⏳ ']' ; '¥' [4] RangeItems : RangeItems ⏳ RangeItem ; ']' 'char' [6] RangeItem : ⏳ 'char' ; ']' 'char' ") syntaxState7("syntaxState7 [2] Scope : '[' 'firstItem1' ']' ⏳ ; '¥' ") syntaxState8("syntaxState8 [5] RangeItems : RangeItem ⏳ ; ']' 'char' ") syntaxState9("syntaxState9 [6] RangeItem : 'char' ⏳ ; ']' 'char' ") syntaxState10("syntaxState10 [1] Scope : '[^' 'firstItem2' RangeItems ⏳ ']' ; '¥' [4] RangeItems : RangeItems ⏳ RangeItem ; ']' 'char' [6] RangeItem : ⏳ 'char' ; ']' 'char' ") syntaxState11("syntaxState11 [3] Scope : '[^' 'firstItem2' ']' ⏳ ; '¥' ") syntaxState12("syntaxState12 [0] Scope : '[' 'firstItem1' RangeItems ']' ⏳ ; '¥' ") syntaxState13("syntaxState13 [4] RangeItems : RangeItems RangeItem ⏳ ; ']' 'char' ") syntaxState14("syntaxState14 [1] Scope : '[^' 'firstItem2' RangeItems ']' ⏳ ; '¥' ") syntaxState0 -.-> |"Scope"| syntaxState1 syntaxState0 --> |"'['"| syntaxState2 syntaxState0 --> |"'[^'"| syntaxState3 syntaxState2 --> |"'firstItem1'"| syntaxState4 syntaxState3 --> |"'firstItem2'"| syntaxState5 syntaxState4 -.-> |"RangeItems"| syntaxState6 syntaxState4 --> |"']'"| syntaxState7 syntaxState4 -.-> |"RangeItem"| syntaxState8 syntaxState4 --> |"'char'"| syntaxState9 syntaxState5 -.-> |"RangeItems"| syntaxState10 syntaxState5 --> |"']'"| syntaxState11 syntaxState5 -.-> |"RangeItem"| syntaxState8 syntaxState5 --> |"'char'"| syntaxState9 syntaxState6 --> |"']'"| syntaxState12 syntaxState6 -.-> |"RangeItem"| syntaxState13 syntaxState6 --> |"'char'"| syntaxState9 syntaxState10 --> |"']'"| syntaxState14 syntaxState10 -.-> |"RangeItem"| syntaxState13 syntaxState10 --> |"'char'"| syntaxState9 syntaxState1 o--o |"'¥'"| syntaxState1 syntaxState7 x==x |"'¥' R[2]= Scope : '[' 'firstItem1' ']' ;"| syntaxState7 syntaxState8 x==x |"']' 'char' R[5]= RangeItems : RangeItem ;"| syntaxState8 syntaxState9 x==x |"']' 'char' R[6]= RangeItem : 'char' ;"| syntaxState9 syntaxState11 x==x |"'¥' R[3]= Scope : '[^' 'firstItem2' ']' ;"| syntaxState11 syntaxState12 x==x |"'¥' R[0]= Scope : '[' 'firstItem1' RangeItems ']' ;"| syntaxState12 syntaxState13 x==x |"']' 'char' R[4]= RangeItems : RangeItems RangeItem ;"| syntaxState13 syntaxState14 x==x |"'¥' R[1]= Scope : '[^' 'firstItem2' RangeItems ']' ;"| syntaxState14

LR(1) Syntax Machine

状态 '[' 'firstItem1' ']' '[^' 'firstItem2' 'char' '¥' Scope RangeItems RangeItem
0 S2 S3 G1
1 完成
2 S4
3 S5
4 S7 S9 G6 G8
5 S11 S9 G10 G8
6 S12 S9 G13
7 R[2]
8 R[5] R[5]
9 R[6] R[6]
10 S14 S9 G13
11 R[3]
12 R[0]
13 R[4] R[4]
14 R[1]
flowchart classDef default fill:#C7EDCC,stroke:#993399,stroke-width:0px,text-align:left; classDef titlebarStyle fill:gold; titlebar>"LR(1) syntax states"] class titlebar titlebarStyle syntaxState0("syntaxState0 [-1] ResolvedScope> : ⏳ Scope ; '¥' [0] Scope : ⏳ '[' 'firstItem1' RangeItems ']' ; '¥' [1] Scope : ⏳ '[^' 'firstItem2' RangeItems ']' ; '¥' [2] Scope : ⏳ '[' 'firstItem1' ']' ; '¥' [3] Scope : ⏳ '[^' 'firstItem2' ']' ; '¥' ") syntaxState1("syntaxState1 [-1] ResolvedScope> : Scope ⏳ ; '¥' ") syntaxState2("syntaxState2 [0] Scope : '[' ⏳ 'firstItem1' RangeItems ']' ; '¥' [2] Scope : '[' ⏳ 'firstItem1' ']' ; '¥' ") syntaxState3("syntaxState3 [1] Scope : '[^' ⏳ 'firstItem2' RangeItems ']' ; '¥' [3] Scope : '[^' ⏳ 'firstItem2' ']' ; '¥' ") syntaxState4("syntaxState4 [0] Scope : '[' 'firstItem1' ⏳ RangeItems ']' ; '¥' [2] Scope : '[' 'firstItem1' ⏳ ']' ; '¥' [4] RangeItems : ⏳ RangeItems RangeItem ; ']' 'char' [5] RangeItems : ⏳ RangeItem ; ']' 'char' [6] RangeItem : ⏳ 'char' ; ']' 'char' ") syntaxState5("syntaxState5 [1] Scope : '[^' 'firstItem2' ⏳ RangeItems ']' ; '¥' [3] Scope : '[^' 'firstItem2' ⏳ ']' ; '¥' [4] RangeItems : ⏳ RangeItems RangeItem ; ']' 'char' [5] RangeItems : ⏳ RangeItem ; ']' 'char' [6] RangeItem : ⏳ 'char' ; ']' 'char' ") syntaxState6("syntaxState6 [0] Scope : '[' 'firstItem1' RangeItems ⏳ ']' ; '¥' [4] RangeItems : RangeItems ⏳ RangeItem ; ']' 'char' [6] RangeItem : ⏳ 'char' ; ']' 'char' ") syntaxState7("syntaxState7 [2] Scope : '[' 'firstItem1' ']' ⏳ ; '¥' ") syntaxState8("syntaxState8 [5] RangeItems : RangeItem ⏳ ; ']' 'char' ") syntaxState9("syntaxState9 [6] RangeItem : 'char' ⏳ ; ']' 'char' ") syntaxState10("syntaxState10 [1] Scope : '[^' 'firstItem2' RangeItems ⏳ ']' ; '¥' [4] RangeItems : RangeItems ⏳ RangeItem ; ']' 'char' [6] RangeItem : ⏳ 'char' ; ']' 'char' ") syntaxState11("syntaxState11 [3] Scope : '[^' 'firstItem2' ']' ⏳ ; '¥' ") syntaxState12("syntaxState12 [0] Scope : '[' 'firstItem1' RangeItems ']' ⏳ ; '¥' ") syntaxState13("syntaxState13 [4] RangeItems : RangeItems RangeItem ⏳ ; ']' 'char' ") syntaxState14("syntaxState14 [1] Scope : '[^' 'firstItem2' RangeItems ']' ⏳ ; '¥' ") syntaxState0 -.-> |"Scope"| syntaxState1 syntaxState0 --> |"'['"| syntaxState2 syntaxState0 --> |"'[^'"| syntaxState3 syntaxState2 --> |"'firstItem1'"| syntaxState4 syntaxState3 --> |"'firstItem2'"| syntaxState5 syntaxState4 -.-> |"RangeItems"| syntaxState6 syntaxState4 --> |"']'"| syntaxState7 syntaxState4 -.-> |"RangeItem"| syntaxState8 syntaxState4 --> |"'char'"| syntaxState9 syntaxState5 -.-> |"RangeItems"| syntaxState10 syntaxState5 --> |"']'"| syntaxState11 syntaxState5 -.-> |"RangeItem"| syntaxState8 syntaxState5 --> |"'char'"| syntaxState9 syntaxState6 --> |"']'"| syntaxState12 syntaxState6 -.-> |"RangeItem"| syntaxState13 syntaxState6 --> |"'char'"| syntaxState9 syntaxState10 --> |"']'"| syntaxState14 syntaxState10 -.-> |"RangeItem"| syntaxState13 syntaxState10 --> |"'char'"| syntaxState9 syntaxState1 o--o |"'¥'"| syntaxState1 syntaxState7 x==x |"'¥' R[2]= Scope : '[' 'firstItem1' ']' ;"| syntaxState7 syntaxState8 x==x |"']' 'char' R[5]= RangeItems : RangeItem ;"| syntaxState8 syntaxState9 x==x |"']' 'char' R[6]= RangeItem : 'char' ;"| syntaxState9 syntaxState11 x==x |"'¥' R[3]= Scope : '[^' 'firstItem2' ']' ;"| syntaxState11 syntaxState12 x==x |"'¥' R[0]= Scope : '[' 'firstItem1' RangeItems ']' ;"| syntaxState12 syntaxState13 x==x |"']' 'char' R[4]= RangeItems : RangeItems RangeItem ;"| syntaxState13 syntaxState14 x==x |"'¥' R[1]= Scope : '[^' 'firstItem2' RangeItems ']' ;"| syntaxState14

End

标签:解析器,--,一键,RangeItems,char,_-,Scope,RangeItem
From: https://www.cnblogs.com/bitzhuwei/p/Scope-readme-full.html

相关文章

  • 一键生成`ABB`文法解析器
    CompilerofABBTheC#sourcecodeofthecompilerABBisgeneratedbybitzhuwei.GrammarFormat.Grammar//3VnRegulations:A:A'+'B//[0]|'a';//[1]B:'b';//[2]//0VtPatterns:LexicalAnalyzerStatesflowc......
  • JeecgBoot低代码平台—多租户SAAS解决方案,实现一键切换
    JeecgBoot免费低代码平台,提供一键切换多租户模式机制!快速实现全系统的saas租户方案,通过租户ID进行数据隔离。租户设计思路1、开启全系统租户隔离开启方法将org.jeecg.config.mybatis.MybatisPlusSaasConfig#OPEN_SYSTEM_TENANT_CONTROL改成true开启实现功能:系统管......
  • SwitchHosts 一款管理本地 host 文件配置的工具,支持一键切换不同环境配置的 host 文件
    简介Hosts相关的小工具着实不少,大家需求最多的肯定是hosts切换工具了。SwitchHosts!是一款可以方便你管理和一键切换多个hosts方案的免费开源工具,跨平台支持Windows、macOS和Linux系统。软件获取➤https://www.hereitis.cn/articleDetails/1269功能介绍SwitchHos......
  • Mac打印机一键安装
    1、创建文件夹创建文件夹主要是为了后面东西打包方便。名字随意。我这里创建名为:Macos2、下载打印机驱动打印机驱动格式一般是pkg格式,其他格式的暂未测试,如果是其他格式的可以直接看我的代码怎么写的参考一下我的逻辑。3、创建配置文件注意‼️:在刚才创建的文件夹下午创建......
  • 如何用 Serverless 一键部署 Stable Diffusion?
    思路其实很简单,我们只需要将镜像里面的动态路径映射到NAS文件存储里面即可,利用NAS独立存储文件模型,扩展,语言包等,并且我们可以为管理NAS单独配置一个可视化的后台,用简单的文件上传删除的方式管理我们的文件,为此我们需要展开打镜像的脚本,为了完成全套的流程我们接下来盘一下......
  • 【自己更换模型】如何用 Serverless 一键部署 Stable Diffusion?
    作者:寒斜上一篇讲了如何使用ServerlessDevs和函数计算快速体验部署StableDiffusion,本篇继续聊聊如何解决动态模型加载的问题,从玩起来到用起来。思路其实很简单,我们只需要将镜像里面的动态路径映射到NAS[1]文件存储里面即可,利用NAS独立存储文件模型,扩展,语言包等,并且......
  • Spring Boot 单体应用一键升级成 Spring Cloud Alibaba
    作者:十眠背景随着ApacheDubbo、Nacos以及SpringCloud等服务框架的流行,越来越多的企业开始采用微服务架构来构建其应用程序。微服务架构使企业能够将其应用程序拆分成多个小型服务,这些服务可以独立部署和扩展。这种架构模式也使企业更容易实现敏捷开发和持续交付,从而提高了......
  • JAVA快速开发框架 一键生成表单模板代码
    从计算机诞生开始,虽然编程的形式随着硬件及软件的不断进步而不停迭代,但是从事计算机技术行业的人员始终与编写代码的任务紧密联系在一起。因此如何提高软件开发的效率和质量,一直是软件工程领域的重要问题之一。这一方面是由于在不同软件开发过程中存在大量相似代码复用的情况,多次......
  • JAVA快速开发框架 一键生成表单模板代码
    从计算机诞生开始,虽然编程的形式随着硬件及软件的不断进步而不停迭代,但是从事计算机技术行业的人员始终与编写代码的任务紧密联系在一起。因此如何提高软件开发的效率和质量,一直是软件工程领域的重要问题之一。这一方面是由于在不同软件开发过程中存在大量相似代码复用的情况,多次编......
  • PS一键磨皮插件delicious retouch插件(DR5白金版)
    哪里可以获取PS一键磨皮插件deliciousretouch插件中文激活版资源呢?DeliciousRetouch是一款Photoshop扩展插件,旨在帮助用户快速、高效地进行照片修饰和美化。它提供了多种功能和工具,可以帮助用户轻松地修饰肤色、磨皮、润色、增强细节等,使得照片更加美观自然。DeliciousRetouch......