mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
Simplify grammar and sync with ConceptCore
This commit is contained in:
parent
435411eba7
commit
abc24822d2
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
@ -105,6 +105,7 @@
|
||||||
"rsgraph",
|
"rsgraph",
|
||||||
"rslang",
|
"rslang",
|
||||||
"rstemplates",
|
"rstemplates",
|
||||||
|
"setexpr",
|
||||||
"SIDELIST",
|
"SIDELIST",
|
||||||
"signup",
|
"signup",
|
||||||
"Slng",
|
"Slng",
|
||||||
|
|
|
@ -135,6 +135,7 @@ This is the build for local Development
|
||||||
- copy import wheels from ConceptCore to rsconcept/backend/import
|
- copy import wheels from ConceptCore to rsconcept/backend/import
|
||||||
- run rsconcept/backend/LocalEnvSetup.ps1
|
- run rsconcept/backend/LocalEnvSetup.ps1
|
||||||
- use VSCode configs in root folder to start development
|
- use VSCode configs in root folder to start development
|
||||||
|
- use 'npm run prepare' to regenerate frontend parsers (if you change grammar files)
|
||||||
|
|
||||||
## 🔭 Local docker build
|
## 🔭 Local docker build
|
||||||
|
|
||||||
|
|
|
@ -1,36 +1,16 @@
|
||||||
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
||||||
export const
|
export const
|
||||||
Expression = 1,
|
Expression = 1,
|
||||||
LogicPredicate = 2,
|
Literal = 2,
|
||||||
Literal = 3,
|
Local = 3,
|
||||||
Local = 4,
|
Index = 4,
|
||||||
Index = 5,
|
Global = 5,
|
||||||
Global = 6,
|
Radical = 6,
|
||||||
Radical = 7,
|
Filter = 20,
|
||||||
BinaryOperation = 8,
|
ComplexIndex = 21,
|
||||||
Enumeration = 21,
|
PrefixD = 26,
|
||||||
Tuple = 22,
|
PrefixI = 27,
|
||||||
Boolean = 23,
|
PrefixR = 31,
|
||||||
Declarative = 25,
|
Function = 32,
|
||||||
PrefixD = 28,
|
TextFunction = 33,
|
||||||
Variable = 29,
|
Predicate = 45
|
||||||
VariableComposite = 30,
|
|
||||||
PrefixI = 31,
|
|
||||||
Imperative = 32,
|
|
||||||
ImperativeBlocks = 33,
|
|
||||||
ImperativeIteration = 34,
|
|
||||||
ImperativeAssignment = 36,
|
|
||||||
ImperativeCondition = 38,
|
|
||||||
PrefixR = 40,
|
|
||||||
Recursion = 41,
|
|
||||||
FunctionCall = 43,
|
|
||||||
Function = 44,
|
|
||||||
TextFunctionExpression = 46,
|
|
||||||
TextFunction = 47,
|
|
||||||
ComplexIndex = 48,
|
|
||||||
Filter = 49,
|
|
||||||
Predicate = 61,
|
|
||||||
LogicQuantor = 64,
|
|
||||||
QuantorVariable = 66,
|
|
||||||
LogicBinary = 68,
|
|
||||||
FunctionDeclaration = 73
|
|
||||||
|
|
|
@ -8,37 +8,45 @@ const testData = [
|
||||||
['∅', '[Expression[Literal]]'],
|
['∅', '[Expression[Literal]]'],
|
||||||
['Z', '[Expression[Literal]]'],
|
['Z', '[Expression[Literal]]'],
|
||||||
['1', '[Expression[Literal]]'],
|
['1', '[Expression[Literal]]'],
|
||||||
['12<41', '[Expression[LogicPredicate[Literal][<][Literal]]]'],
|
['12<41', '[Expression[Literal][<][Literal]]'],
|
||||||
['12=41', '[Expression[LogicPredicate[Literal][=][Literal]]]'],
|
['12=41', '[Expression[Literal][=][Literal]]'],
|
||||||
['ξ=ξ', '[Expression[LogicPredicate[Local][=][Local]]]'],
|
['ξ=ξ', '[Expression[Local][=][Local]]'],
|
||||||
['0-5', '[Expression[BinaryOperation[Literal][-][Literal]]]'],
|
['0-5', '[Expression[Literal][-][Literal]]'],
|
||||||
['¬2=2', '[Expression[LogicNegation[¬][LogicPredicate[Literal][=][Literal]]]]'],
|
['¬2=2', '[Expression[¬][Literal][=][Literal]]'],
|
||||||
['12+41', '[Expression[BinaryOperation[Literal][+][Literal]]]'],
|
['12+41', '[Expression[Literal][+][Literal]]'],
|
||||||
['1+2*5', '[Expression[BinaryOperation[BinaryOperation[Literal][+][Literal]][*][Literal]]]'],
|
['1+2*5', '[Expression[Literal][+][Literal][*][Literal]]'],
|
||||||
['a1∪Z', '[Expression[BinaryOperation[Local[Index]][∪][Literal]]]'],
|
['a1∪Z', '[Expression[Local[Index]][∪][Literal]]'],
|
||||||
['Pr1(X1)', '[Expression[TextFunctionExpression[TextFunction[ComplexIndex]][(][Global][)]]]'],
|
['Pr1(X1)', '[Expression[TextFunction[ComplexIndex]][(][Global][)]]'],
|
||||||
['Pr11(X1)', '[Expression[TextFunctionExpression[TextFunction[ComplexIndex]][(][Global][)]]]'],
|
['Pr11(X1)', '[Expression[TextFunction[ComplexIndex]][(][Global][)]]'],
|
||||||
['Pr11,21(X1)', '[Expression[TextFunctionExpression[TextFunction[ComplexIndex]][(][Global][)]]]'],
|
['Pr11,21(X1)', '[Expression[TextFunction[ComplexIndex]][(][Global][)]]'],
|
||||||
['pr1(S1)', '[Expression[TextFunctionExpression[TextFunction[ComplexIndex]][(][Global][)]]]'],
|
['pr1(S1)', '[Expression[TextFunction[ComplexIndex]][(][Global][)]]'],
|
||||||
['Pr1,2(X1)', '[Expression[TextFunctionExpression[TextFunction[ComplexIndex]][(][Global][)]]]'],
|
['Pr1,2(X1)', '[Expression[TextFunction[ComplexIndex]][(][Global][)]]'],
|
||||||
['card(X1)', '[Expression[TextFunctionExpression[TextFunction][(][Global][)]]]'],
|
['card(X1)', '[Expression[TextFunction][(][Global][)]]'],
|
||||||
['red(X1)', '[Expression[TextFunctionExpression[TextFunction][(][Global][)]]]'],
|
['red(X1)', '[Expression[TextFunction][(][Global][)]]'],
|
||||||
['bool(X1)', '[Expression[TextFunctionExpression[TextFunction][(][Global][)]]]'],
|
['bool(X1)', '[Expression[TextFunction][(][Global][)]]'],
|
||||||
['debool(X1)', '[Expression[TextFunctionExpression[TextFunction][(][Global][)]]]'],
|
['debool(X1)', '[Expression[TextFunction][(][Global][)]]'],
|
||||||
['Fi1,2[ξ, ξ](ξ)', '[Expression[TextFunctionExpression[Filter[ComplexIndex]][[][Local][Local][]][(][Local][)]]]'],
|
['Fi1,2[ξ, ξ](ξ)', '[Expression[Filter][ComplexIndex][[][Local][Local][]][(][Local][)]]'],
|
||||||
['ℬℬ(X1)', '[Expression[Boolean[ℬ][Boolean[ℬ][(][Global][)]]]]'],
|
['ℬℬ(X1)', '[Expression[ℬ][ℬ][(][Global][)]]'],
|
||||||
['P2[S1]', '[Expression[PredicateCall[Predicate][[][Global][]]]]'],
|
['P2[S1]', '[Expression[Predicate][[][Global][]]]'],
|
||||||
['[σ∈R1×R1] F6[σ]', '[Expression[FunctionDeclaration[[][Local][∈][BinaryOperation[Radical][×][Radical]][]][FunctionCall[Function][[][Local][]]]]]'],
|
['[σ∈R1×R1] F6[σ]', '[Expression[[][Local][∈][Radical][×][Radical][]][Function][[][Local][]]]'],
|
||||||
['D{ξ∈red(S1) | ξ=ξ}', '[Expression[Declarative[PrefixD][{][Variable[Local]][∈][TextFunctionExpression[TextFunction][(][Global][)]][|][LogicPredicate[Local][=][Local]][}]]]'],
|
['D{ξ∈red(S1) | ξ=ξ}', '[Expression[PrefixD][{][Local][∈][TextFunction][(][Global][)][|][Local][=][Local][}]]'],
|
||||||
['I{(σ, γ) | σ:∈X1; γ:=F1[σ]; P1[σ, γ]}', '[Expression[Imperative[PrefixI][{][Tuple[(][Local][Local][)]][|][ImperativeBlocks[ImperativeBlocks[ImperativeBlocks[ImperativeIteration[Local][:∈][Global]]][;][ImperativeAssignment[Local][:=][FunctionCall[Function][[][Local][]]]]][;][ImperativeCondition[PredicateCall[Predicate][[][Local][Local][]]]]][}]]]'],
|
[
|
||||||
['R{ξ:=D1 | F1[ξ]≠∅ | ξ∪F1[ξ]}', '[Expression[Recursion[PrefixR][{][Variable[Local]][:=][Global][|][LogicPredicate[FunctionCall[Function][[][Local][]]][≠][Literal]][|][BinaryOperation[Local][∪][FunctionCall[Function][[][Local][]]]][}]]]'],
|
'I{(σ, γ) | σ:∈X1; γ:=F1[σ]; P1[σ, γ]}',
|
||||||
['∀ξ∈∅ 1=1', '[Expression[LogicQuantor[∀][QuantorVariable[Variable[Local]]][∈][Literal][LogicPredicate[Literal][=][Literal]]]]'],
|
'[Expression[PrefixI][{][(][Local][Local][)][|][Local][:∈][Global][;][Local][:=][Function][[][Local][]][;][Predicate][[][Local][Local][]][}]]'
|
||||||
['∀ξ1∈β (ξ1≠∅ & ∀ξ2∈β ξ1∩ξ2=∅)', '[Expression[LogicQuantor[∀][QuantorVariable[Variable[Local[Index]]]][∈][Local][(][LogicBinary[LogicPredicate[Local[Index]][≠][Literal]][&][LogicQuantor[∀][QuantorVariable[Variable[Local[Index]]]][∈][Local][LogicPredicate[BinaryOperation[Local[Index]][∩][Local[Index]]][=][Literal]]]][)]]]']
|
],
|
||||||
|
[
|
||||||
|
'R{ξ:=D1 | F1[ξ]≠∅ | ξ∪F1[ξ]}',
|
||||||
|
'[Expression[PrefixR][{][Local][:=][Global][|][Function][[][Local][]][≠][Literal][|][Local][∪][Function][[][Local][]][}]]'
|
||||||
|
],
|
||||||
|
['∀ξ∈∅ 1=1', '[Expression[∀][Local][∈][Literal][Literal][=][Literal]]'],
|
||||||
|
[
|
||||||
|
'∀ξ1∈β (ξ1≠∅ & ∀ξ2∈β ξ1∩ξ2=∅)',
|
||||||
|
'[Expression[∀][Local[Index]][∈][Local][(][Local[Index]][≠][Literal][&][∀][Local[Index]][∈][Local][Local[Index]][∩][Local[Index]][=][Literal][)]]'
|
||||||
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
describe('Testing RSParser', () => {
|
describe('Testing RSParser', () => {
|
||||||
it.each(testData)('Parse %p',
|
it.each(testData)('Parse %p', (input: string, expectedTree: string) => {
|
||||||
(input: string, expectedTree: string) => {
|
|
||||||
// NOTE: use strict parser to determine exact error position
|
// NOTE: use strict parser to determine exact error position
|
||||||
// const tree = parser.configure({strict: true}).parse(input);
|
// const tree = parser.configure({strict: true}).parse(input);
|
||||||
const tree = parser.parse(input);
|
const tree = parser.parse(input);
|
||||||
|
|
|
@ -3,20 +3,16 @@ import {LRParser} from "@lezer/lr"
|
||||||
import {highlighting} from "./highlight"
|
import {highlighting} from "./highlight"
|
||||||
export const parser = LRParser.deserialize({
|
export const parser = LRParser.deserialize({
|
||||||
version: 14,
|
version: 14,
|
||||||
states: "7WO!sQPOOOOQO'#C_'#C_O!zQPO'#C`O&bQPO'#D{OVQPO'#CdO&iQPO'#CqO'yQPO'#CsO(RQPO'#CuO(WQPO'#C|O(]QPO'#DVOOQO'#ES'#ESO(bQPO'#DXO(gQQO'#D]OOQO'#D]'#D]O(lQQO'#D_O(qQPO'#D[O(vQPO'#D[OOQO'#D}'#D}O({QPO'#DjOVQPO'#DlO)QQPO'#DnOOQO'#Ea'#EaO)YQPO'#D{OOQO'#D|'#D|O)TQPO'#DwQOQPOOOOQO'#Ca'#CaOOQO,58z,58zO&iQPO,59OO&iQPO,59OO&iQPO,59OO&iQPO,59OO&iQPO,59OO&iQPO,59OO&iQPO,59OO&iQPO,59OO&iQPO,58xO)kQPO'#ETO+PQPO,59OO+ZQPO'#EUO+`QPO,59^O+hQPO,5:}O,eQPO'#ETO&iQPO'#CdO,rQPO,59]OOQO'#ET'#ETO-fQPO,59aO&iQPO,59_OOQO,59_,59_O)QQPO,59aO&iQPO,59hO)QQPO,59qO&iQPO,59sOOQO,59w,59wOOQO,59y,59yO&iQPO,59vO&iQPO,59vO&iQPO,5:UO%TQPO'#C^OOQO,5:W,5:WOOQO'#Cy'#CyO)QQPO'#CyO-sQPO,5:YOOQO'#Dp'#DpOVQPO,5:^OVQPO,5:^OVQPO,5:^OVQPO,5:^O-{QPO'#EeOOQO'#Ed'#EdO.QQPO,5:cOOQO1G.j1G.jO0VQPO1G.jO0^QPO1G.jO2bQPO1G.jO4fQPO1G.jO4mQPO1G.jO4tQPO1G.jO5^QPO1G.jO7PQPO1G.dO&iQPO,5:pOOQO1G.x1G.xOOQO1G0i1G0iOOQO1G.w1G.wO&iQPO1G.{O7pQPO1G.yO7wQPO1G.{O7|QPO1G/S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y#|$X$[$]$^$_$`$a$b$cQyU[![d!R!T!]#Q#eS!dg#XT#o#`#zRjQ#TaOTUbklmnopqrs{!O!S!V!W!Z!`!a!b!c!p!s!v#R#W#Y#_#`#a#h#l#w#x#y#z#|$X$[$]$^$_$`$a$b$cQhOR#k#YSeO#YQxTQ!YbQ#S!`Q#T!aQ#U!bQ#V!cS#p#`#zQ#u#hQ#v#lQ$P#xR$T#|mfOTb!`!a!b!c#Y#`#h#l#x#z#|SSO#YQtTYzU{!V!Z!vd!Xb!`!a!b!c#`#h#l#x#zS!gk$[Q!hlQ!imQ!jnQ!koQ!lpQ!mqQ!nrQ!osQ!u!OQ!x!SQ!{!WQ#Z!pQ#[!sQ#h#RQ#i#WQ#n#_Q#s#aQ$O#wQ$Q#yQ$S#|Q$Y$XQ$d$]Q$e$^Q$f$_Q$g$`Q$h$aQ$i$bR$j$c#O_OUbklmnopqrs!O!S!V!W!Z!`!a!b!c!p!s!v#R#W#Y#_#`#a#h#l#w#x#y#z#|$X$[$]$^$_$`$a$b$cTuT{#T[OTUbklmnopqrs{!O!S!V!W!Z!`!a!b!c!p!s!v#R#W#Y#_#`#a#h#l#w#x#y#z#|$X$[$]$^$_$`$a$b$cSvT{Q|UQ!z!VQ!|!ZR#^!vSwT{X}U!V!Z!v#S[OTUbklmnopqrs{!O!S!V!W!Z!`!a!b!c!p!s!v#R#W#Y#_#`#a#h#l#w#x#y#z#|$X$[$]$^$_$`$a$b$cR!PVQ!_dQ!w!RQ!y!TQ!}!]Q#f#QR#t#eR#O!]R#P!]R#r#`Q#q#`R$R#zR!^dR!_dRhOR!fgQ!egR#j#X",
|
||||||
nodeNames: "⚠ Expression LogicPredicate Literal Local Index Global Radical BinaryOperation + - * ∪ \\ ∆ ∩ × ( ) } { Enumeration Tuple Boolean ℬ Declarative ∈ | PrefixD Variable VariableComposite PrefixI Imperative ImperativeBlocks ImperativeIteration :∈ ImperativeAssignment := ImperativeCondition ; PrefixR Recursion ] FunctionCall Function [ TextFunctionExpression TextFunction ComplexIndex Filter ∉ ⊆ ⊄ ⊂ > ≥ < ≤ ≠ = PredicateCall Predicate LogicNegation ¬ LogicQuantor ∀ QuantorVariable ∃ LogicBinary ⇔ ⇒ ∨ & FunctionDeclaration",
|
nodeNames: "⚠ Expression Literal Local Index Global Radical + - * ∪ \\ ∆ ∩ × ( ) { } ℬ Filter ComplexIndex [ ] ∈ | PrefixD PrefixI :∈ := ; PrefixR Function TextFunction ∉ ⊆ ⊄ ⊂ > ≥ < ≤ ≠ = ¬ Predicate ∀ ∃ ⇔ ⇒ ∨ &",
|
||||||
maxTerm: 101,
|
maxTerm: 93,
|
||||||
nodeProps: [
|
|
||||||
["closedBy", 17,")",20,"}"],
|
|
||||||
["openedBy", 18,"(",19,"{"]
|
|
||||||
],
|
|
||||||
propSources: [highlighting],
|
propSources: [highlighting],
|
||||||
skippedNodes: [0],
|
skippedNodes: [0],
|
||||||
repeatNodeCount: 0,
|
repeatNodeCount: 0,
|
||||||
tokenData: "4i~R!jX^%spq%svw&hxy&myz&rz{&w{|&||}'R}!O'W!Q!R']!R[!h!i)d!k!l)z!r!s*P!t!u*g!u!v(|!v!w(|!z!{(|!|!}*w!}#O*|#O#P+R#P#Q+W#R#S+]#T#U+]#U#V+h#V#W,z#W#X.Z#X#d+]#d#e0a#e#f+]#f#g1P#g#o+]#o#p2Q#p#q2V#q#r2[#y#z%s$f$g%s$r$s2a%o%p2f5i6S+]#BY#BZ%s$IS$I_%s$I|$JO%s$JT$JU%s$KV$KW%s% l% m2k%%Y%%Z2p%%[%%]2u%&Y%&Z2z%&]%&^3P%&_%&`3U%&`%&a3Z%&b%&c3`%&c%&d3e%'S%'T3j%'T%'U3o%'U%'V3t%(^%(_3y%(b%(c4O%(c%(d4T%)Q%)R4Y%)S%)T4_%)U%)V4d&FU&FV%s~%xY!n~X^%spq%s#y#z%s$f$g%s#BY#BZ%s$IS$I_%s$I|$JO%s$JT$JU%s$KV$KW%s&FU&FV%s~&mO!j~~&rOa~~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-k#g#o+]5i6S+]~-pS!a~#T#W+]#W#X-|#X#o+]5i6S+]~.TQ!u~!a~#T#o+]5i6S+]~.`S!a~#T#X+]#X#Y.l#Y#o+]5i6S+]~.qS!a~#T#U+]#U#V.}#V#o+]5i6S+]~/SS!a~#T#c+]#c#d/`#d#o+]5i6S+]~/eS!a~#T#c+]#c#d/q#d#o+]5i6S+]~/vS!a~#T#`+]#`#a0S#a#o+]5i6S+]~0ZQ!w~!a~#T#o+]5i6S+]~0fS!a~#T#f+]#f#g0r#g#o+]5i6S+]~0yQ!t~!a~#T#o+]5i6S+]~1US!a~#T#X+]#X#Y1b#Y#o+]5i6S+]~1gS!a~#T#W+]#W#X1s#X#o+]5i6S+]~1zQ!x~!a~#T#o+]5i6S+]~2VOa~~2[Oi~~2aOb~~2fO|~~2kO^~~2pOc~~2uO!R~~2zO!Q~~3PO!O~~3UO!P~~3ZO!^~~3`O[~~3eOh~~3jOr~~3oO!S~~3tO]~~3yOY~~4OOz~~4TOy~~4YOw~~4_Ou~~4dOt~~4iOs~",
|
||||||
tokenizers: [0, 1],
|
tokenizers: [0, 1],
|
||||||
topRules: {"Expression":[0,1]},
|
topRules: {"Expression":[0,1]},
|
||||||
tokenPrec: 1955
|
tokenPrec: 1974
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// ------------- Generator Definitions --------------------
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
@detectDelim
|
||||||
|
@external propSource highlighting from "./highlight"
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// ------------- Precedence Definitions --------------------
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
@precedence {
|
@precedence {
|
||||||
plus @left minus @left,
|
plus @left minus @left,
|
||||||
times @left,
|
times @left,
|
||||||
|
@ -12,13 +21,9 @@
|
||||||
p1, p2
|
p1, p2
|
||||||
}
|
}
|
||||||
|
|
||||||
@top Expression {
|
///////////////////////////////////////////////////////////
|
||||||
term_or_logic |
|
// ------------- Terminal Tokens --------------------------
|
||||||
FunctionDeclaration
|
///////////////////////////////////////////////////////////
|
||||||
}
|
|
||||||
|
|
||||||
@skip { space }
|
|
||||||
|
|
||||||
@tokens {
|
@tokens {
|
||||||
space { @whitespace+ }
|
space { @whitespace+ }
|
||||||
ComplexIndex { $[1-9]$[0-9]*(","$[1-9]$[0-9]*)* }
|
ComplexIndex { $[1-9]$[0-9]*(","$[1-9]$[0-9]*)* }
|
||||||
|
@ -28,7 +33,7 @@
|
||||||
|
|
||||||
bigPr { "Pr" }
|
bigPr { "Pr" }
|
||||||
smallPr { "pr" }
|
smallPr { "pr" }
|
||||||
filter { "Fi" }
|
Filter { "Fi" }
|
||||||
card { "card" }
|
card { "card" }
|
||||||
bool { "bool" }
|
bool { "bool" }
|
||||||
debool { "debool" }
|
debool { "debool" }
|
||||||
|
@ -55,146 +60,207 @@
|
||||||
"{" "}"
|
"{" "}"
|
||||||
"(" ")"
|
"(" ")"
|
||||||
|
|
||||||
@precedence { filter bigPr Predicate Function Global Radical PrefixR PrefixI PrefixD }
|
@precedence {
|
||||||
@precedence { card bool debool red smallPr local }
|
Filter
|
||||||
|
bigPr
|
||||||
|
Predicate
|
||||||
|
Function
|
||||||
|
Global
|
||||||
|
Radical
|
||||||
|
PrefixR
|
||||||
|
PrefixI
|
||||||
|
PrefixD
|
||||||
|
}
|
||||||
|
@precedence {
|
||||||
|
card
|
||||||
|
bool
|
||||||
|
debool
|
||||||
|
red
|
||||||
|
smallPr
|
||||||
|
local
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Index { integer }
|
@skip { space }
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// ------------------------- Grammar Rules ------------------------------------
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// ------------------------- Language Expression ------------------------------
|
||||||
|
@top Expression {
|
||||||
|
logic_or_setexpr |
|
||||||
|
function_decl
|
||||||
|
}
|
||||||
|
logic_or_setexpr {
|
||||||
|
logic |
|
||||||
|
setexpr
|
||||||
|
}
|
||||||
|
function_decl {
|
||||||
|
"[" arguments "]" logic_or_setexpr
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------------- Variables and arguments -------------------------
|
||||||
|
arguments {
|
||||||
|
declaration |
|
||||||
|
arguments "," declaration
|
||||||
|
}
|
||||||
|
declaration {
|
||||||
|
Local "∈" setexpr
|
||||||
|
}
|
||||||
Local {
|
Local {
|
||||||
!p1 local |
|
!p1 local |
|
||||||
!p2 local Index
|
!p2 local Index
|
||||||
}
|
}
|
||||||
|
Index {
|
||||||
Literal { integer | emptySet | integerSet }
|
integer
|
||||||
|
}
|
||||||
TextFunction {
|
variable {
|
||||||
bigPr ComplexIndex |
|
Local |
|
||||||
smallPr ComplexIndex |
|
"(" variableComposite ")"
|
||||||
card | bool | debool | red
|
}
|
||||||
|
variableComposite {
|
||||||
|
var_all "," variable
|
||||||
|
}
|
||||||
|
var_all {
|
||||||
|
variable |
|
||||||
|
variableComposite
|
||||||
}
|
}
|
||||||
|
|
||||||
Filter { filter ComplexIndex }
|
|
||||||
|
|
||||||
term_or_logic { logic | term }
|
|
||||||
|
|
||||||
FunctionDeclaration { "[" arg_declaration "]" term_or_logic }
|
|
||||||
arg_declaration {
|
|
||||||
declaration |
|
|
||||||
arg_declaration "," declaration
|
|
||||||
}
|
|
||||||
declaration { Local "∈" term }
|
|
||||||
|
|
||||||
|
// ------------------------- Logic Expressions --------------------------------
|
||||||
logic {
|
logic {
|
||||||
LogicPredicate |
|
logic_predicates |
|
||||||
logicUnary |
|
logic_unary |
|
||||||
LogicBinary |
|
logic_binary |
|
||||||
logic_par
|
"(" logic ")"
|
||||||
}
|
|
||||||
logic_par { "(" logic ")" }
|
|
||||||
logicUnary {
|
|
||||||
PredicateCall { Predicate "[" term_enum "]" } |
|
|
||||||
LogicNegation { !not "¬" logic } |
|
|
||||||
LogicQuantor
|
|
||||||
}
|
|
||||||
LogicQuantor {
|
|
||||||
"∀" QuantorVariable "∈" term !quant logic |
|
|
||||||
"∃" QuantorVariable "∈" term !quant logic
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LogicPredicate {
|
logic_predicates {
|
||||||
term "∈" term |
|
setexpr "∈" setexpr |
|
||||||
term "∉" term |
|
setexpr "∉" setexpr |
|
||||||
term "⊆" term |
|
setexpr "⊆" setexpr |
|
||||||
term "⊄" term |
|
setexpr "⊄" setexpr |
|
||||||
term "⊂" term |
|
setexpr "⊂" setexpr |
|
||||||
term ">" term |
|
setexpr ">" setexpr |
|
||||||
term "≥" term |
|
setexpr "≥" setexpr |
|
||||||
term "<" term |
|
setexpr "<" setexpr |
|
||||||
term "≤" term |
|
setexpr "≤" setexpr |
|
||||||
term "≠" term |
|
setexpr "≠" setexpr |
|
||||||
term "=" term
|
setexpr "=" setexpr
|
||||||
}
|
}
|
||||||
|
|
||||||
LogicBinary {
|
logic_unary {
|
||||||
|
!not "¬" logic |
|
||||||
|
Predicate "[" setexpr_enum "]" |
|
||||||
|
"∀" quant_var "∈" setexpr !quant logic |
|
||||||
|
"∃" quant_var "∈" setexpr !quant logic
|
||||||
|
}
|
||||||
|
quant_var {
|
||||||
|
variable |
|
||||||
|
quant_var_enum
|
||||||
|
}
|
||||||
|
quant_var_enum {
|
||||||
|
quant_var "," variable
|
||||||
|
}
|
||||||
|
|
||||||
|
logic_binary {
|
||||||
logic !log_equiv "⇔" logic |
|
logic !log_equiv "⇔" logic |
|
||||||
logic !log_impl "⇒" logic |
|
logic !log_impl "⇒" logic |
|
||||||
logic !log_or "∨" logic |
|
logic !log_or "∨" logic |
|
||||||
logic !log_and "&" logic
|
logic !log_and "&" logic
|
||||||
}
|
}
|
||||||
|
|
||||||
QuantorVariable { Variable | quant_var_enum }
|
|
||||||
quant_var_enum { QuantorVariable "," Variable }
|
|
||||||
Variable { Local | "(" VariableComposite ")" }
|
|
||||||
VariableComposite { var_all "," Variable }
|
|
||||||
var_all { Variable | VariableComposite }
|
|
||||||
|
|
||||||
term {
|
// ------------------------- Set Expressions ----------------------------------
|
||||||
Literal | Local | Global | Radical |
|
setexpr {
|
||||||
BinaryOperation |
|
Literal |
|
||||||
typed_constructors |
|
identifier |
|
||||||
FunctionCall |
|
setexpr_binary |
|
||||||
TextFunctionExpression
|
setexpr_generators |
|
||||||
|
Function "[" setexpr_enum "]" |
|
||||||
|
TextFunction "(" setexpr ")"
|
||||||
}
|
}
|
||||||
FunctionCall { Function "[" term_enum "]" }
|
TextFunction {
|
||||||
|
bigPr ComplexIndex |
|
||||||
TextFunctionExpression {
|
smallPr ComplexIndex |
|
||||||
TextFunction "(" term ")" |
|
card |
|
||||||
Filter "[" term_enum "]" "(" term ")"
|
bool |
|
||||||
|
debool |
|
||||||
|
red
|
||||||
|
}
|
||||||
|
setexpr_enum {
|
||||||
|
setexpr |
|
||||||
|
setexpr_enum_min2
|
||||||
|
}
|
||||||
|
setexpr_enum_min2 {
|
||||||
|
setexpr_enum "," setexpr
|
||||||
}
|
}
|
||||||
|
|
||||||
BinaryOperation {
|
Literal {
|
||||||
term !plus "+" term |
|
integer |
|
||||||
term !minus "-" term |
|
emptySet |
|
||||||
term !times "*" term |
|
integerSet
|
||||||
term !set_union "∪" term |
|
}
|
||||||
term !set_minus "\\" term |
|
identifier {
|
||||||
term !set_symminus "∆" term |
|
Local |
|
||||||
term !set_intersect "∩" term |
|
Global |
|
||||||
term !set_decart "×" term |
|
Radical
|
||||||
"(" BinaryOperation ")"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
typed_constructors {
|
setexpr_binary {
|
||||||
Enumeration |
|
setexpr !plus "+" setexpr |
|
||||||
Tuple |
|
setexpr !minus "-" setexpr |
|
||||||
Boolean |
|
setexpr !times "*" setexpr |
|
||||||
Declarative |
|
setexpr !set_union "∪" setexpr |
|
||||||
Imperative |
|
setexpr !set_minus "\\" setexpr |
|
||||||
Recursion
|
setexpr !set_symminus "∆" setexpr |
|
||||||
}
|
setexpr !set_intersect "∩" setexpr |
|
||||||
Enumeration { "{" term_enum "}"}
|
setexpr !set_decart "×" setexpr |
|
||||||
Tuple { "(" term_enum_min2 ")"}
|
"(" setexpr_binary ")"
|
||||||
Boolean {
|
|
||||||
!set_bool "ℬ" "(" term ")" |
|
|
||||||
!set_bool "ℬ" Boolean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
term_enum { term | term_enum_min2 }
|
setexpr_generators {
|
||||||
term_enum_min2 { term_enum "," term }
|
enumeration |
|
||||||
|
tuple |
|
||||||
|
boolean |
|
||||||
|
filter_expression |
|
||||||
|
declarative |
|
||||||
|
imperative |
|
||||||
|
recursion
|
||||||
|
}
|
||||||
|
enumeration {
|
||||||
|
"{" setexpr_enum "}"
|
||||||
|
}
|
||||||
|
tuple {
|
||||||
|
"(" setexpr_enum_min2 ")"
|
||||||
|
}
|
||||||
|
boolean {
|
||||||
|
!set_bool "ℬ" "(" setexpr ")" |
|
||||||
|
!set_bool "ℬ" boolean
|
||||||
|
}
|
||||||
|
filter_expression {
|
||||||
|
Filter ComplexIndex "[" setexpr_enum "]" "(" setexpr ")"
|
||||||
|
}
|
||||||
|
|
||||||
Declarative {
|
declarative {
|
||||||
"{" Local "∈" term "|" logic "}" |
|
"{" Local "∈" setexpr "|" logic "}" |
|
||||||
PrefixD "{" Variable "∈" term "|" logic "}"
|
PrefixD "{" variable "∈" setexpr "|" logic "}"
|
||||||
}
|
}
|
||||||
Recursion {
|
recursion {
|
||||||
PrefixR "{" Variable ":=" term ("|" logic)? "|" term "}"
|
PrefixR "{" variable ":=" setexpr ("|" logic)? "|" setexpr "}"
|
||||||
}
|
}
|
||||||
Imperative {
|
imperative {
|
||||||
PrefixI "{" term "|" ImperativeBlocks "}"
|
PrefixI "{" setexpr "|" imp_blocks "}"
|
||||||
}
|
}
|
||||||
ImperativeBlocks {
|
imp_blocks {
|
||||||
imp_block |
|
imp_block |
|
||||||
ImperativeBlocks ";" imp_block
|
imp_blocks ";" imp_block
|
||||||
}
|
}
|
||||||
imp_block {
|
imp_block {
|
||||||
ImperativeIteration |
|
Local ":∈" setexpr |
|
||||||
ImperativeAssignment |
|
Local ":=" setexpr |
|
||||||
ImperativeCondition
|
logic
|
||||||
}
|
}
|
||||||
ImperativeIteration { Local ":∈" term }
|
|
||||||
ImperativeAssignment { Local ":=" term }
|
|
||||||
ImperativeCondition { logic }
|
|
||||||
|
|
||||||
@detectDelim
|
|
||||||
|
|
||||||
@external propSource highlighting from "./highlight"
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
@detectDelim
|
||||||
|
@external propSource highlighting from "./highlight"
|
||||||
|
|
||||||
@top Expression { token* }
|
@top Expression { token* }
|
||||||
|
|
||||||
@skip { space }
|
@skip { space }
|
||||||
|
@ -26,19 +29,40 @@
|
||||||
"[" "]"
|
"[" "]"
|
||||||
"{" "}"
|
"{" "}"
|
||||||
|
|
||||||
@precedence { filter bigPr Global Radical ConstructPrefix }
|
@precedence {
|
||||||
@precedence { card bool debool red smallPr local }
|
filter
|
||||||
@precedence { Integer space }
|
bigPr
|
||||||
|
Global
|
||||||
|
Radical
|
||||||
|
ConstructPrefix
|
||||||
|
}
|
||||||
|
@precedence {
|
||||||
|
card
|
||||||
|
bool
|
||||||
|
debool
|
||||||
|
red
|
||||||
|
smallPr
|
||||||
|
local
|
||||||
|
}
|
||||||
|
@precedence {
|
||||||
|
Integer
|
||||||
|
space
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TextFunction {
|
TextFunction {
|
||||||
bigPr ComplexIndex |
|
bigPr ComplexIndex |
|
||||||
smallPr ComplexIndex |
|
smallPr ComplexIndex |
|
||||||
filter ComplexIndex |
|
filter ComplexIndex |
|
||||||
card | bool | debool | red
|
card |
|
||||||
|
bool |
|
||||||
|
debool |
|
||||||
|
red
|
||||||
}
|
}
|
||||||
|
|
||||||
Local { local Index? }
|
Local {
|
||||||
|
local Index?
|
||||||
|
}
|
||||||
|
|
||||||
token {
|
token {
|
||||||
TextFunction |
|
TextFunction |
|
||||||
|
@ -48,7 +72,3 @@ token {
|
||||||
Radical |
|
Radical |
|
||||||
Local
|
Local
|
||||||
}
|
}
|
||||||
|
|
||||||
@detectDelim
|
|
||||||
|
|
||||||
@external propSource highlighting from "./highlight"
|
|
Loading…
Reference in New Issue
Block a user