blob: 0c7a1087faa31fba69c8a660904faffda63943c4 [file] [log] [blame] [edit]
/**
# Lexical structure
*/
[helper]
Digit
: ["0".."9"];
IntegerLiteral
: Digit+?
FloatLiteral
: <Java double literal>;
[helper]
HexDigit
: Digit | ["A".."F", "a".."f"];
HexadecimalLiteral
: "0x" HexDigit+;
CharacterLiteral
: <character as in Java>;
/**
See [Basic types](basic-types.html)
*/
NoEscapeString
: <"""-quoted string>;
RegularStringPart
: <any character other than backslash, quote, $ or newline>
ShortTemplateEntryStart:
: "$"
EscapeSequence:
: UnicodeEscapeSequence | RegularEscapeSequence
UnicodeEscapeSequence:
: "\u" HexDigit{4}
RegularEscapeSequence:
: "\" <any character other than newline>
/**
See [String templates](basic-types.html#templates)
*/
SEMI
: <semicolon or newline>;
SimpleName
: <java identifier>
: "`" <java identifier> "`"
;
/**
See [Java interoperability](java-interop.html)
*/
FieldName
: "$" SimpleName;
/*
See [Properties And Fields](properties.html)
*/
LabelName
: "@" SimpleName;
/**
See [Returns and jumps](returns.html)
*/
/* Symbols:
[](){}<>
,
.
:
<= >= == != === !==
+ - * / %
=
+= -= *= /= %=
++ -- !
&& || -- may be just & and |
=>
..
?
?:
?.
*/
/* Keywords:
package
as
type
class
this
val
var
fun
extension
for
null
typeof
new
true
false
is
in
throw
return
break
continue
object
if
else
while
do
when
out
ref
try
Soft:
where -- in class, function and type headers
by -- in a class header (Delegation specifier)
get, set -- in a property definition
import
final
abstract
enum
open
annotation
override
private
public
internal
protected
catch
finally
*/