-
Notifications
You must be signed in to change notification settings - Fork 2
/
lexeme_skel.conf
27 lines (26 loc) · 1.39 KB
/
lexeme_skel.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
###########################################################################################
# delimiters: ',' , ';' , ':' , ' ' , '(' , '[' , ')' , ']' , '{' , '}' #
# and all of the OPERATORS with COMPARISON and ASSIGNMENT OPERATORS #
# #
# some characters are special which couldn't be used for #
# the regex name in the left of the configuration assignments #
# consists of: '(' , '[' , ')' , ']' , '+' , '*' , '&' , '|' , '.' #
# #
# if you wanna use delimiters combining by other strings as a separate lexeme, #
# you have to add it at the end of the file #
###########################################################################################
DIGIT := [0-9]
SEPARATOR := \[|\(|\]|\)|{|}|;|,
LETTER := [a-z]|[A-Z]
SINGLE_QUOTATION := '
DOUBLE_QUOTATION := "
OPERATOR_ASSIGNMENT := -=|\+=|\*=|/=|=
OPERATOR := \+|\*|-|/|\+\+|--
OPERATOR_LOGICAL := \&\&|\|\||\&|\||!
OPERATOR_COMPARISON := <|>|<=|>=|!=|==
NUMBER_REAL := \DIGIT*\.\DIGIT+
NUMBER_INTEGER := \DIGIT+
KEY_WORD := if|else|while|int|char|real|string|list|array|empty|class|public|and|or|assign|less|more|equal|not|plus|minus|mod|inc
ID := \LETTER(\LETTER|_|\DIGIT)+
LITERAL := ".*"|'.*'
COMMENT := @@#(\NUMBER_INTEGER)-(\DOUBLE_QUOTATION).*(\DOUBLE_QUOTATION)