Silverfly
  • Welcome
  • Getting Started
    • Quickstart
    • Tokens
  • Basics
    • Lexer
      • Matcher
        • IgnoreMatcher
        • Custom Matcher
    • Parser
      • Parselet
    • Traverse the Tree
    • Read Eval Print Loop
    • Looking at the tree
  • Experts
    • Custom Naming Rules
    • Tree Rewriting
  • Guides
    • JSON
    • Parsing Predecesors
    • Using Multiple Tokens As Operators
  • Support
Powered by GitBook
On this page
  1. Getting Started

Tokens

PreviousQuickstartNextLexer

Last updated 8 months ago

A token is a semantical group of charakters. Special tokens are tagges with leading #.

Token
Description
Example

#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

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