A GramQuestion is a question handler that parses an answer using a grammar rule.
class
GramQuestion : Question
Superclass Tree (in declaration order)
GramQuestion
Question
object
Subclass Tree
GramQuestion
YesNoQuestion
Global Objects
(none)
Summary of Properties
answerFunc
answerProd
Inherited from Question
:
answerTemplate
priority
Summary of Methods
construct
makeCommand
parseAnswer
Properties
the callback function that carries out the reply action
the GrammarProd rule that we use to parse the answer
Methods
Create a simple question. 'prod' is the root GrammarProd to use for parsing the reply. 'func' is a callback function that carries out the action of the answering the question. 'func' is invoked with a single argument giving the Command object representing the answer; you can get the match tree from the Command if you need the parsed form of the answer input.
Create a Command object for a successful grammar match. 'prod' is the root match object of the grammar match. This returns a suitable Command that carries out the action of answering the question.
Parse the answer. We'll match the token list against the grammar rule. If we find a match, we'll call makeCommand() to create the command to carry out the action of answering the question.
Adv3Lite Library Reference Manual
Generated on 03/07/2024 from adv3Lite version 2.1