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{}/* 111 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 // [...] 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 NICHT // nicht GLEICH // gleich UNGLEICH // ungleich KLEINER // kleiner (als) GRÖßER // größer (als)(, oder) groesser (als)(, oder) 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 DER DIE VON ALS WENN DANN ABER SONST SOLANGE FÜR JEDE JEDEN BIS MIT SCHRITTGRÖßE ZAHL ZAHLEN KOMMAZAHL KOMMAZAHLEN BOOLEAN BUCHSTABE BUCHSTABEN TEXT LISTE LISTEN REFERENZ FUNKTION BINDE EIN GIB ZURÜCK NICHTS UM BIT NACH VERSCHOBEN LOGISCH MACHE WIEDERHOLE DEM PARAMETER DEN PARAMETERN VOM TYP GIBT EINE EINEN MACHT KANN SO BENUTZT WERDEN SPEICHERE DAS ERGEBNIS IN AN STELLE VONBIS DEFINIERT LEERE LEEREN AUS BESTEHT EINER VERLASSE COUNT_MAL ALIAS STEHT OEFFENTLICHE DOT // . COMMA // , COLON // : LPAREN // ( RPAREN // ) )
func KeywordToTokenType ¶
Click to show internal directories.
Click to hide internal directories.