-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalltip.lark
More file actions
53 lines (50 loc) · 1.66 KB
/
calltip.lark
File metadata and controls
53 lines (50 loc) · 1.66 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
func_def: [out_arg_list "="] func_name "(" [in_arg_list] ")"
func_name: ID ("." ID)*
_type: type | array_type | array_type_fixed | array_type_range | array_type_min
_basic_type: T_INT | T_FLOAT | T_DOUBLE | T_BOOL | T_BUFFER | T_STRING | T_MATRIX | T_VECTOR | T_VECTOR3 | T_QUATERNION | T_POSE | T_COLOR | T_HANDLE | T_MAP | T_FUNC | T_ANY
type: _basic_type
array_type: _basic_type "[" "]"
array_type_fixed: _basic_type "[" NUM "]"
array_type_range: _basic_type "[" NUM T_RANGE NUM "]"
array_type_min: _basic_type "[" NUM T_RANGE T_STAR "]"
?value: map | array | SIGNED_NUMBER -> number | string | "true" -> true | "false" -> false | "nil" -> nil | ID ("." ID)* -> id
string: ESCAPED_STRING | SINGLE_QUOTED_STRING
map: "{" [ID "=" value ("," ID "=" value)*] "}"
array: "{" [value ("," value)*] "}"
arg: _type name
name: ID
_arg_list: arg ("," arg)*
arg_with_default: _type name "=" default
default: value
_arg_list_with_default: arg_with_default ("," arg_with_default)*
in_arg_list: (varargs | (_arg_list "," _arg_list_with_default | _arg_list_with_default | _arg_list) ["," varargs])
out_arg_list: (varargs | _arg_list ["," varargs])
varargs: T_VARARGS
T_INT: "int"
T_FLOAT: "float"
T_DOUBLE: "double"
T_BOOL: "bool"
T_BUFFER: "buffer"
T_STRING: "string"
T_MATRIX: "matrix"
T_VECTOR: "vector"
T_VECTOR3: "vector3"
T_QUATERNION: "quaternion"
T_POSE: "pose"
T_COLOR: "color"
T_HANDLE: "handle"
T_MAP: "map"
T_FUNC: "func"
T_ANY: "any"
T_VARARGS: "..."
T_RANGE: ".."
T_STAR: "*"
ID: /[a-z_][a-z0-9_]*/i
NUM: /[0-9]+/
SINGLE_QUOTED_STRING : /'[^']*'/
NUMBER: FLOAT ( "f" )? | INT
SIGNED_NUMBER: ["+"|"-"] NUMBER
%import common.FLOAT
%import common.INT
%import common.ESCAPED_STRING
%ignore /[ \n\t\r]/x