Merge remote-tracking branch 'origin/master' into windows
[scilab.git] / scilab / modules / ast / includes / exps / token.hxx
1 /*
2  *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  *  Copyright (C) 2007-2008 - DIGITEO - Bruno JOFRET
4  *
5  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  *
7  * This file is hereby licensed under the terms of the GNU GPL v2.0,
8  * pursuant to article 5.3.4 of the CeCILL v.2.1.
9  * This file was originally licensed under the terms of the CeCILL v2.1,
10  * and continues to be available under such terms.
11  * For more information, see the COPYING file which you should have received
12  * along with this program.
13  *
14  */
15
16 #ifndef __AST_TOKEN_HXX__
17 #define __AST_TOKEN_HXX__
18
19 /** Scilab tokens and key words
20  ** \{ */
21
22 #define SCI_DOT                             "."
23
24 #define SCI_TRUE                            "%T"
25 #define SCI_FALSE                           "%F"
26
27 #define SCI_INT8                            "int8"
28 #define SCI_INT16                           "int16"
29 #define SCI_INT32                           "int32"
30 #define SCI_INT64                           "int64"
31 #define SCI_LPAREN                          "("
32 #define SCI_RPAREN                          ")"
33 #define SCI_LBRACE                          "{"
34 #define SCI_RBRACE                          "}"
35 #define SCI_LBRACK                          "["
36 #define SCI_RBRACK                          "]"
37
38 #define SCI_PLUS                            "+"
39 #define SCI_MINUS                           "-"
40 #define SCI_TIMES                           "*"
41 #define SCI_RDIVIDE                         "/"
42 #define SCI_LDIVIDE                         "\\"
43 #define SCI_POWER                           "^"
44
45 #define SCI_DOTTIMES                    ".*"
46 #define SCI_DOTRDIVIDE                  "./"
47 #define SCI_DOTLDIVIDE                  ".\\"
48 #define SCI_DOTPOWER                    ".^"
49
50 #define SCI_KRONTIMES                   ".*."
51 #define SCI_KRONRDIVIDE                 "./."
52 #define SCI_KRONLDIVIDE                 ".\\."
53
54 #define SCI_CONTROLTIMES                "*."
55 #define SCI_CONTROLRDIVIDE              "/."
56 #define SCI_CONTROLLDIVIDE              "\\."
57
58 #define SCI_EQ                              "=="
59 #define SCI_NE                              "<>"
60 #define SCI_GE                              ">="
61 #define SCI_GT                              ">"
62 #define SCI_LE                              "<="
63 #define SCI_LT                              "<"
64
65 #define SCI_AND                             "&"
66 #define SCI_OR                              "|"
67 #define SCI_ANDAND                      "&&"
68 #define SCI_OROR                            "||"
69 #define SCI_NOT                             "~"
70
71 #define SCI_CONJUGATE_TRANSPOSE     "'"
72 #define SCI_TRANSPOSE                   ".'"
73
74 #define SCI_QUOTE                           "\'"
75 #define SCI_DQUOTE                          "\""
76 #define SCI_COMMA                           ","
77 #define SCI_SEMICOLON               ";"
78 #define SCI_COLON                           ":"
79
80 #define SCI_DOLLAR                          "$"
81
82 #define SCI_ASSIGN                          "="
83 #define SCI_OPEN_COMMENT                "//"
84
85 // Syntax to acces field 'bar' in variable 'foo'
86 // foo.var
87 #define SCI_FVAR_SEPARATOR          SCI_DOT
88
89 // Syntax to access indexed variable in 'foo'
90 // foo(5)
91 #define SCI_SVAR_OPEN                   SCI_LPAREN
92 #define SCI_SVAR_CLOSE                  SCI_RPAREN
93
94 // Syntax to do strings
95 #define SCI_OPEN_STRING                 SCI_DQUOTE
96 #define SCI_CLOSE_STRING                SCI_DQUOTE
97
98 // Syntax to have function calls
99 #define SCI_OPEN_CALL                   SCI_LPAREN
100 #define SCI_CLOSE_CALL                  SCI_RPAREN
101 #define SCI_ARGS_SEPARATOR              SCI_COMMA
102
103 // Syntax to have if control structure
104 #define SCI_IF                              "if"
105 #define SCI_THEN                            "then"
106 #define SCI_ELSE                            "else"
107 #define SCI_ENDIF                           "end"
108 #define SCI_OPEN_TEST                   SCI_LPAREN
109 #define SCI_CLOSE_TEST                  SCI_RPAREN
110
111 // Syntax to have while control structure
112 #define SCI_WHILE                           "while"
113 #define SCI_DO                              "do"
114 #define SCI_ENDWHILE                    "end"
115
116 // Syntax to have for control structure
117 #define SCI_FOR                             "for"
118 #define SCI_ENDFOR                          "end"
119 #define SCI_BREAK                           "break"
120 #define SCI_CONTINUE                "continue"
121
122 // Syntax to have try/catch control structure
123 #define SCI_TRY                             "try"
124 #define SCI_CATCH                           "catch"
125 #define SCI_ENDTRY                          "end"
126
127 // Syntax to have function declaration
128 #define SCI_FUNCTION                    "function"
129 #define SCI_OPEN_RETURNS                SCI_LBRACK
130 #define SCI_CLOSE_RETURNS               SCI_RBRACK
131 #define SCI_OPEN_ARGS                   SCI_LPAREN
132 #define SCI_CLOSE_ARGS                  SCI_RPAREN
133 #define SCI_ENDFUNCTION                 "endfunction"
134
135 // Syntax to have select control structure
136 #define SCI_SELECT                          "select"
137 #define SCI_CASE                            "case"
138 #define SCI_DEFAULT_CASE            "else"
139 #define SCI_ENDSELECT               "end"
140
141 // Syntax to have return control structure
142 #define SCI_RETURN                          "return"
143
144 // Syntax to describe implicit list
145 #define SCI_IMPLICIT_LIST       SCI_COLON
146
147 // Syntax to write Matrices
148 #define SCI_OPEN_MATRIX                 SCI_LBRACK
149 #define SCI_CLOSE_MATRIX                SCI_RBRACK
150 #define SCI_LINE_SEPARATOR              SCI_SEMICOLON
151 #define SCI_COLUMN_SEPARATOR        SCI_COMMA
152
153 // Syntax to write Cells
154 #define SCI_OPEN_CELL                   SCI_LBRACE
155 #define SCI_CLOSE_CELL                  SCI_RBRACE
156
157
158 /** \} */
159
160 #endif /* !__AST_TOKEN_HXX__ */