-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspec.txt
31 lines (23 loc) · 870 Bytes
/
spec.txt
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
28
29
30
31
Syntax:
PAREN_EXPR = <PAREN_L> <EXPRESSION> <PAREN_R>
EXPRESSION = <BIN_OPER_PAIR> | <UN_OPER_PAIR> | <PAREN_EXPR>
BIN_OPER_PAIR = <NUMBER> <BIN_OPER> <NUMBER>
| <BIN_OPER_PAIR> <BIN_OPER> <NUMBER>
| <PAREN_EXPR> <BIN_OPER> <NUMBER>
UN_OPER_PAIR = <UN_OPER> <NUMBER> | <UN_OPER> <PAREN_EXPR>
---------------------------------
Tokens:
NUMBER = <DIGIT_SET> | '.' <DIGIT_SET> | <DIGIT_SET> '.' <DIGIT_SET>
BIN_OPER = '+' | '-' | '*' | '/' | '^'
UN_OPER = '-'
PAREN_L = '('
PAREN_R = ')'
- Whitespace will end a token if not ended otherwise
---------------------------------
Token component:
DIGIT_SET = <DIGIT> | <DIGIT> <DIGIT_SET>
DIGIT = [0-9]
IDENT_SET = <IDENT_START> | <IDENT_START> <IDENT_BODY_SET>
IDENT_BODY_SET = <IDENT_BODY> | <IDENT_BODY> <IDENT_BODY_SET>
IDENT_BODY = <IDENT_START> | [0-9]
IDENT_START = '_' | [a-z] | [A-Z]