ALLOWED TOKEN TYPES

Token types begin with an '@' sign and indicate to the grammar engine that the current token (being checked ) must of the specified token type. The allowed token types are listed below. These are typically used in "expr" ( expression ) based plugins.

TOKEN-TYPE PLUGIN-USE IS COLLECTED DESCRIPTION EXAMPLE
@number expr yes token must be a number 3 / 4.4
@bool expr yes token must be a boolean true/false
@date expr yes token must be a date 7/1/2012
@time expr yes token must be a time 7:10 am
@word expr yes token must be any word name
@identsymbol expr yes token must be in the symbol table username
@starttoken expr yes token must be in the "starttoken" map in metaplugin
@tokenmap1 expr yes token must be in the "tokenmap1" map in metaplugin
@tokenmap2 expr yes token must be in the "tokenmap2" map in metaplugin
@exprTerminators expr no token must be in Terminators.ExpFlexibleEnd


SUPPORTED TOKEN PROPERTIES

Token properties are used by suffixing the token-types above with "." followed by the property name. For example @startoken.value, or @number.tvalue, or @time.tvaluestring. This will get the respective properties of the tokens and make them available in arguments for the metaplugin parse method.

PROPERTY NAME APPLICABLE TO DESCRIPTION EXAMPLE
value starttoken, tokenmap1, tokenmap2 only applies to @starttoken, gets the value of the starttoken in the metaplugin n/a
tvalue any token type applies to any token and returns the Value property of the token as an LObject @number.tvalue = LNumber(2.0)
tvaluestring any token type applies to any token and returns the Value property of the token as an LString @number.tvaluestring = LString("2")
ttext any token type applies to any token and returns the Text property of the token as an LString @word.ttext = LString("wordacb")

Last edited Feb 9, 2013 at 9:55 PM by kishore_reddy, version 6

Comments

No comments yet.