Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

52
LINES

< > BotCompany Repo | #1008837 // ctxParsingRules - for bottom-up parser

JavaX fragment (include)

1  
static S ctxParsingRules() {
2  
  ret [[
3  
<identifier> = ruleid
4  
<int> = ruleid
5  
<int> <identifier> = ruleid
6  
<ruleid> - <ruleid> = ruleid
7  
8  
RULE <ruleid> ( <exp> ) = rule
9  
10  
<id> ( ) = fcall
11  
<id> ( <exp> ) = fcall
12  
<fcall> = expX
13  
14  
<expX> == <expX> = comp
15  
<comp> = expX
16  
17  
<id> = varOrQuoted
18  
<quoted> = varOrQuoted
19  
20  
<expX> != <expX> = uneq
21  
<uneq> = expX
22  
23  
<id> #= <quoted> = match
24  
<match> = expX
25  
26  
// bracketing combines top and bottom
27  
( <exp> ) = bracket
28  
<bracket> = expX
29  
30  
// primitive expressions are at top level
31  
<quoted> = expX
32  
<id> = expX
33  
34  
// as is negation
35  
! <expX> = neg
36  
<neg> = expX
37  
38  
// now come the lower levels
39  
<expX> = exp3
40  
41  
<exp2> & & <exp3> = and
42  
<exp3> = exp2
43  
<and> = exp2
44  
45  
<exp1> | | <exp2> = or
46  
<exp2> = exp1
47  
<or> = exp1
48  
49  
// lowest level
50  
<exp1> = exp
51  
]];
52  
}

Author comment

Began life as a copy of #1008817

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1008837
Snippet name: ctxParsingRules - for bottom-up parser
Eternal ID of this version: #1008837/22
Text MD5: ed0fe3c89e49c945c41f1457d7e95e50
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-01 19:02:10
Source code size: 808 bytes / 52 lines
Pitched / IR pitched: No / No
Views / Downloads: 597 / 636
Version history: 21 change(s)
Referenced in: [show references]