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)

static S ctxParsingRules() {
  ret [[
<identifier> = ruleid
<int> = ruleid
<int> <identifier> = ruleid
<ruleid> - <ruleid> = ruleid

RULE <ruleid> ( <exp> ) = rule

<id> ( ) = fcall
<id> ( <exp> ) = fcall
<fcall> = expX

<expX> == <expX> = comp
<comp> = expX

<id> = varOrQuoted
<quoted> = varOrQuoted

<expX> != <expX> = uneq
<uneq> = expX

<id> #= <quoted> = match
<match> = expX

// bracketing combines top and bottom
( <exp> ) = bracket
<bracket> = expX

// primitive expressions are at top level
<quoted> = expX
<id> = expX

// as is negation
! <expX> = neg
<neg> = expX

// now come the lower levels
<expX> = exp3

<exp2> & & <exp3> = and
<exp3> = exp2
<and> = exp2

<exp1> | | <exp2> = or
<exp2> = exp1
<or> = exp1

// lowest level
<exp1> = exp
]];
}

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: 509 / 549
Version history: 21 change(s)
Referenced in: [show references]