Tokens
Last updated
Last updated
A token is a semantical group of charakters. Special tokens are tagges with leading #.
Token | Description | Example |
---|---|---|
Silverfly has a list of predefined symbols that includes the special token types above and the most common symbols from various programming languages. The lexer will be populated on initialization with this list so you don't have to register all your operatory by your self. The list can be found here.
#number
A number that allows seperation, decimal point, binary and hexadecimal digits
3.14e5
#boolean
Boolean values
true
#name
An Identifier like names of methods and classes. The default naming rule: [_a-z]*
My_SuperClass
#string
A string constant. Can be configured to allow unicode and escape sequences
"hello \t world"
#sof
Represents the start of a file
#eof
Represents the end of a file