GramQuestion class | parser.t[1081]

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

`answerFunc` | `parser.t[1120]`

the callback function that carries out the reply action

`answerProd` | `parser.t[1117]`

the GrammarProd rule that we use to parse the answer

Methods

`construct (prod, func)` | `parser.t[1090]`

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.

`makeCommand (prod)` | `parser.t[1114]`

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.

`parseAnswer (toks, dict)`OVERRIDDEN | `parser.t[1101]`

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 25/04/2024 from adv3Lite version 2.0