parse operators
More...
Go to the source code of this file.
|
ANN enum yytokentype | op1 (const m_str) |
|
ANN enum yytokentype | op2 (const m_str) |
|
ANN enum yytokentype | op3 (const m_str) |
|
parse operators
Definition in file dynop.h.
◆ op1()
ANN enum yytokentype op1 |
( |
const m_str | str | ) |
|
Definition at line 5 of file dynop.c.
5 {
7 case '?':
8 return QUESTION;
9 break;
10 case ':':
11 return COLON;
12 break;
13 case '$':
14 return DOLLAR;
15 break;
16 case '+':
17 return PLUS;
18 break;
19 case '-':
20 return MINUS;
21 break;
22 case '*':
23 return TIMES;
24 break;
25 case '/':
26 return DIVIDE;
27 break;
28 case '%':
29 return PERCENT;
30 break;
31 case '~':
32 return TILDA;
33 break;
34 case '<':
35 return LT;
36 break;
37 case '>':
38 return GT;
39 break;
40 case '^':
41 return S_XOR;
42 break;
43 case '|':
44 return OR;
45 break;
46 case '&':
47 return S_AND;
48 break;
49 case '!':
50 return EXCLAMATION;
51 break;
52 case '@':
53 return AROBASE;
54 break;
55 }
56 return DYNOP;
57}
◆ op2()
ANN enum yytokentype op2 |
( |
const m_str | str | ) |
|
Definition at line 59 of file dynop.c.
59 {
61 if (
str[0] ==
'+')
return PLUSPLUS;
62 if (
str[0] ==
'-')
return MINUSMINUS;
63 if (
str[0] ==
'=')
return EQ;
64 if (
str[0] ==
'&')
return AND;
65 if (
str[0] ==
'|')
return OR;
66 if (
str[0] ==
'<')
return SHIFT_LEFT;
67 if (
str[0] ==
'>')
return SHIFT_RIGHT;
68 }
70 if (
str[1] ==
'=')
return LE;
71 return DYNOP;
72 }
74 if (
str[1] ==
'=')
return GE;
75 return DYNOP;
76 }
77 if (
str[0] ==
'!' &&
str[1] ==
'=')
return NEQ;
78 if (
str[0] ==
'?' &&
str[1] ==
':')
return QUESTIONCOLON;
79 if (
str[0] ==
':' &&
str[1] ==
':')
return COLONCOLON;
80 return DYNOP;
81}
◆ op3()
ANN enum yytokentype op3 |
( |
const m_str | str | ) |
|
Definition at line 87 of file dynop.c.
87 {
90 return DYNOP;
91}
static bool match(m_str str, char c)