Documentation
¶
Overview ¶
range.go defines types to work with token positions in an AST these types are not used by Token itself, but are meant to be used by code-analysis tools
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var KeywordMap = map[string]TokenType{}/* 159 elements not displayed */
maps all DDP-keywords to their token-type should not be modified!
Functions ¶
This section is empty.
Types ¶
type Position ¶
type Position struct {
Line uint // 1-based Line index in the corresponding file
Column uint // 1-based Column index in the corresponding file
}
a position in a ddp source-file Line and Column are 1-based and measured in utf8-characters not bytes
type Range ¶
type Range struct {
Start Position // First Character position in the Range
End Position // Last Character position in the Range
}
a range in a ddp source-file
type Token ¶
type Token struct {
Type TokenType // type of the token
Literal string // the literal from which it was scanned
Indent uint // how many levels it is indented
Range Range // the range the token spans
AliasInfo *ddptypes.ParameterType // only present in ALIAS_PARAMETERs, holds type information, nil otherwise
}
a single ddp token
func (*Token) StringVerbose ¶
type TokenType ¶
type TokenType int
const ( ILLEGAL TokenType = iota EOF IDENTIFIER ALIAS_PARAMETER // <x> only found in function aliases COMMENT // [...] SYMBOL // any symbol not matched otherwise (?, !, ~, ...) INT // 1 2 FLOAT // 2,2 3,4 STRING // "hallo" "hi\n" CHAR // 'H' 'ü' TRUE // wahr FALSE // falsch PLUS // plus MINUS // minus MAL // mal DURCH // durch MODULO // modulo HOCH // hoch WURZEL // (n.) Wurzel (von) BETRAG // Betrag (von) UND // und ODER // oder ENTWEDER // entweder NICHT // nicht GLEICH // gleich UNGLEICH // ungleich KLEINER // kleiner (als) GRÖßER // größer (als)(, oder) groesser (als)(, oder) ZWISCHEN // zwischen <a> und <b> NEGATE // - IST // ist LINKS // links RECHTS // rechts GRÖßE // Größe von LÄNGE // Länge von KONTRA // kontra VERKETTET // verkettet mit ERHÖHE // += VERRINGERE // -= VERVIELFACHE // *= TEILE // /= VERSCHIEBE // >>= <<= NEGIERE // x = !x ~= LOGARITHMUS ZUR BASIS FALLS // <a>, falls <b>, ansonsten <c> ANSONSTEN // <a>, falls <b>, ansonsten <c> DER DIE VON ALS WENN DANN ABER SONST SOLANGE FÜR JEDE JEDEN JEDES BIS MIT SCHRITTGRÖßE ZAHL ZAHLEN KOMMAZAHL KOMMAZAHLEN BYTE WAHRHEITSWERT BUCHSTABE BUCHSTABEN TEXT LISTE LISTEN REFERENZ FUNKTION BINDE GIB ZURÜCK NICHTS UM BIT NACH VERSCHOBEN LOGISCH MACHE WIEDERHOLE DEM PARAMETER DEN PARAMETERN VOM TYP GIBT EIN EINE EINEN EINER EINEM KEIN KEINE MACHT KANN SO BENUTZT WERDEN SPEICHERE DAS ERGEBNIS IN AN STELLE VONBIS DEFINIERT LEERE LEEREN AUS BESTEHT VERLASSE COUNT_MAL ALIAS STEHT OEFFENTLICH OEFFENTLICHE OEFFENTLICHEN WIR NENNEN DEFINIEREN KOMBINATION STANDARDWERT ERSTELLEN SIE FAHRE SCHLEIFE FORT IM BEREICH AB ZUM ELEMENT EXTERN SICHTBAR SICHTBARE AUCH ÜBERLÄDT OPERATOR VARIABLE VARIABLEN WIRD SPÄTER REKURSIV ALLE MODULE INDEX GENERISCHE KONSTANTE DOT // . COMMA // , COLON // : LPAREN // ( RPAREN // ) ELIPSIS // ... )
func KeywordToTokenType ¶
Click to show internal directories.
Click to hide internal directories.