GrammarToken
Listing of GrammarToken Types »GrammarToken[form]
is a grammar rules pattern object that represents any input of the specified form.
Details
- GrammarToken is used in GrammarRules, along with FixedOrder, AnyOrder, etc.
- GrammarToken works with any form supported by Interpreter.
- New forms can be introduced by giving rules for GrammarToken["string"] in GrammarRules.
Examples
open allclose allBasic Examples (2)
Deploy a grammar that makes use of a built-in GrammarToken:
Apply the grammar to an input:
Deploy a grammar that defines and uses an "Appliance" token:
Scope (1)
A custom GrammarToken can be used before and after its definition in the GrammarRules:
Applications (1)
Properties & Relations (1)
If a definition is given for a built-in GrammarToken, the given definition is used, not the built-in one:
Apply the new definition to an input string:
The replacement for GrammarToken["City"] prevents use of the usual one by this grammar:
Text
Wolfram Research (2014), GrammarToken, Wolfram Language function, https://reference.wolfram.com/language/ref/GrammarToken.html.
CMS
Wolfram Language. 2014. "GrammarToken." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/GrammarToken.html.
APA
Wolfram Language. (2014). GrammarToken. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GrammarToken.html