Change relational language to use math symbols
The symbols previously used were a Canadian script, and were looking good enough, but they might not be installed in every machine. Besides, all this is to workaround a Qt5 bug that prevents from rendering those symbols at times.
This commit is contained in:
parent
7e1c2c964c
commit
8cb08ad030
@ -1,8 +1,12 @@
|
||||
1.3
|
||||
2.0
|
||||
- Fix bug in relational-cli that made it crash when an exception was raised
|
||||
- Point to new website
|
||||
- Drop support for PySide
|
||||
- Switch to Python3 and drop support for Python2
|
||||
- Switch to Qt5
|
||||
- Radical change of language. The UNICODE symbols used previously were meant for a
|
||||
Canadian Aborigenal script. Now switched them to use UNICODE math symbols.
|
||||
- Since the language is changing, take the chance to use better symbols for JOIN
|
||||
|
||||
1.2
|
||||
- Better tokenizer, gives more indicative errors
|
||||
|
@ -50,13 +50,13 @@ BINARY = 2
|
||||
|
||||
PRODUCT = u'*'
|
||||
DIFFERENCE = u'-'
|
||||
UNION = u'ᑌ'
|
||||
INTERSECTION = u'ᑎ'
|
||||
UNION = u'∪'
|
||||
INTERSECTION = u'∩'
|
||||
DIVISION = u'÷'
|
||||
JOIN = u'ᐅᐊ'
|
||||
JOIN_LEFT = u'ᐅLEFTᐊ'
|
||||
JOIN_RIGHT = u'ᐅRIGHTᐊ'
|
||||
JOIN_FULL = u'ᐅFULLᐊ'
|
||||
JOIN = u'⋈'
|
||||
JOIN_LEFT = u'⧑'
|
||||
JOIN_RIGHT = u'⧒'
|
||||
JOIN_FULL = u'⧓'
|
||||
PROJECTION = u'π'
|
||||
SELECTION = u'σ'
|
||||
RENAME = u'ρ'
|
||||
@ -330,7 +330,7 @@ def tokenize(expression):
|
||||
# Removes the entire parentesis and content from the expression
|
||||
expression = expression[end + 1:].strip()
|
||||
|
||||
elif expression.startswith((u"σ", u"π", u"ρ")): # Unary 2 bytes
|
||||
elif expression.startswith((SELECTION, RENAME, PROJECTION)): # Unary 2 bytes
|
||||
items.append(expression[0:1])
|
||||
# Adding operator in the top of the list
|
||||
expression = expression[
|
||||
@ -346,17 +346,10 @@ def tokenize(expression):
|
||||
# Inserting parameter of the operator
|
||||
expression = expression[
|
||||
par:].strip() # Removing parameter from the expression
|
||||
elif expression.startswith((u"÷", u"ᑎ", u"ᑌ", u"*", u"-")):
|
||||
elif expression.startswith((DIVISION, INTERSECTION, UNION, PRODUCT, DIFFERENCE, JOIN, JOIN_LEFT, JOIN_RIGHT, JOIN_FULL)):
|
||||
items.append(expression[0])
|
||||
expression = expression[1:].strip() # 1 char from the expression
|
||||
state = 4
|
||||
elif expression.startswith(u"ᐅ"): # Binary long
|
||||
i = expression.find(u"ᐊ")
|
||||
if i == -1:
|
||||
raise TokenizerException(u"Expected ᐊ in %s" % (expression,))
|
||||
items.append(expression[:i + 1])
|
||||
expression = expression[i + 1:].strip()
|
||||
state = 4
|
||||
elif re.match(r'[_0-9A-Za-z]', expression[0]) == None: # At this point we only have relation names, so we raise errors for anything else
|
||||
raise TokenizerException(
|
||||
"Unexpected '%c' in '%s'" % (expression[0], expression))
|
||||
|
@ -1 +1 @@
|
||||
σ skill=='C'(people ᐅᐊ skills)
|
||||
σ skill=='C'(people ⋈ skills)
|
||||
|
@ -1 +1 @@
|
||||
σ (len(name)==4)(peopleᐅᐊ skills)
|
||||
σ (len(name)==4)(people ⋈ skills)
|
||||
|
@ -1 +1 @@
|
||||
σ name=='eve' (people) ᑎ people
|
||||
σ name=='eve' (people) ∩ people
|
||||
|
@ -1 +1 @@
|
||||
people ᑎ σ name=='eve' (people)
|
||||
people ∩ σ name=='eve' (people)
|
||||
|
@ -1 +1 @@
|
||||
(σ age<25(people) ᑌ σ age>30(people)) ᐅᐊ ratings-πid,name,chief,age,rating(σ rating<r((ρid➡i,rating➡r(π id,rating((σ age<25(people) ᑌ σ age>30(people)) ᐅᐊ ratings))) * (σ age<25(people) ᑌ σ age>30(people)) ᐅᐊ ratings))
|
||||
(σ age<25(people) ∪ σ age>30(people)) ⋈ ratings-πid,name,chief,age,rating(σ rating<r((ρid➡i,rating➡r(π id,rating((σ age<25(people) ∪ σ age>30(people)) ⋈ ratings))) * (σ age<25(people) ∪ σ age>30(people)) ⋈ ratings))
|
||||
|
@ -1 +1 @@
|
||||
σ skill=='C' and age<25 and skill!=name(people ᐅᐊ skills)
|
||||
σ skill=='C' and age<25 and skill!=name(people ⋈ skills)
|
||||
|
@ -1 +1 @@
|
||||
πname,phone(((πname,id(people)- π name,id(πid(σ i!=id and room==r(ρ id➡i,room➡r(person_room)*person_room)) ᐅᐊ people)) ᐅᐊ person_room) ᐅᐊ rooms)
|
||||
πname,phone(((πname,id(people)- π name,id(πid(σ i!=id and room==r(ρ id➡i,room➡r(person_room)*person_room)) ⋈ people)) ⋈ person_room) ⋈ rooms)
|
||||
|
@ -1 +1 @@
|
||||
σ age<30 and skill=='PHP' (people ᐅᐊ skills)
|
||||
σ age<30 and skill=='PHP' (people ⋈ skills)
|
||||
|
@ -1 +1 @@
|
||||
σ (id==2) (σ age>5 (people ᑌ people))
|
||||
σ (id==2) (σ age>5 (people ∪ people))
|
||||
|
@ -1 +1 @@
|
||||
σ skill=='C' and chief==0 ((σ age<30 (people) ᑌ σ age>40(people)) ᐅᐊ skills)
|
||||
σ skill=='C' and chief==0 ((σ age<30 (people) ∪ σ age>40(people)) ⋈ skills)
|
||||
|
@ -1 +1 @@
|
||||
πname,age,skill((ratings-πid,rating(σ r>rating (ρrating➡r(πrating(ratings )) * ratings)) ᐅᐊ people) ᐅᐊ skills)
|
||||
πname,age,skill((ratings-πid,rating(σ r>rating (ρrating➡r(πrating(ratings )) * ratings)) ⋈ people) ⋈ skills)
|
||||
|
@ -1 +1 @@
|
||||
σ age<30 (σ (id%2==0) (people) ᑌ σ age>22(people))
|
||||
σ age<30 (σ (id%2==0) (people) ∪ σ age>22(people))
|
||||
|
@ -1 +1 @@
|
||||
people ᑌ σ name=='eve' (people)
|
||||
people ∪ σ name=='eve' (people)
|
||||
|
@ -1 +1 @@
|
||||
σ name=='eve' (people) ᑌ people
|
||||
σ name=='eve' (people) ∪ people
|
||||
|
@ -1 +1 @@
|
||||
people ᑌ people ᑎ people
|
||||
people ∪ people ∩ people
|
||||
|
@ -1 +1 @@
|
||||
σ skill=='C'(skills) ᑎ σ id%2==0 (skills)
|
||||
σ skill=='C'(skills) ∩ σ id%2==0 (skills)
|
||||
|
@ -1 +1 @@
|
||||
σ age<21 (people) ᑌ σage >30(people)
|
||||
σ age<21 (people) ∪ σage >30(people)
|
||||
|
Loading…
Reference in New Issue
Block a user