mirror of
https://github.com/ganelson/inform.git
synced 2024-06-16 23:30:44 +03:00
Changeover to new Preform notation 4
This commit is contained in:
parent
abf51cb170
commit
05e99b9835
|
@ -91,7 +91,7 @@ word "Include", which might e.g. be "Locksmith by Emily Short".
|
|||
|
||||
<extension-unversioned-inner> ::=
|
||||
<quoted-text> *** | ==> @<Issue PM_IncludeExtQuoted problem@>
|
||||
... ==> 0; <<t1>> = Wordings::first_wn(W); <<t2>> = Wordings::last_wn(W)
|
||||
... ==> { 0, -, <<t1>> = Wordings::first_wn(W), <<t2>> = Wordings::last_wn(W) }
|
||||
|
||||
@ Quite a popular mistake, this:
|
||||
|
||||
|
|
|
@ -247,8 +247,8 @@ and here goes:
|
|||
section ... ==> { 5, - }
|
||||
|
||||
<extension-end-marker-sentence> ::=
|
||||
... begin/begins here | ==> -1; @<Check we can begin an extension here@>;
|
||||
... end/ends here ==> -2; @<Check we can end an extension here@>;
|
||||
... begin/begins here | ==> { -1, - }; @<Check we can begin an extension here@>;
|
||||
... end/ends here ==> { -2, - }; @<Check we can end an extension here@>;
|
||||
|
||||
@ Note that the extension end markers are only read in extensions, so they can
|
||||
never accidentally match in the main source text.
|
||||
|
@ -271,16 +271,16 @@ never accidentally match in the main source text.
|
|||
|
||||
=
|
||||
<structural-sentence> ::=
|
||||
<if-start-of-source-text> <quoted-text> | ==> 0; sfsm->nt = BIBLIOGRAPHIC_NT;
|
||||
<if-start-of-source-text> <quoted-text> ... | ==> 0; sfsm->nt = BIBLIOGRAPHIC_NT;
|
||||
<if-start-of-source-text> <quoted-text> | ==> { 0, - }; sfsm->nt = BIBLIOGRAPHIC_NT;
|
||||
<if-start-of-source-text> <quoted-text> ... | ==> { 0, - }; sfsm->nt = BIBLIOGRAPHIC_NT;
|
||||
<language-modifying-sentence> | ==> { pass 1 }
|
||||
* | ==> 0; sfsm->nt = TRACE_NT;
|
||||
* <quoted-text-without-subs> | ==> 0; sfsm->nt = TRACE_NT;
|
||||
<if-start-of-paragraph> table ... | ==> 0; sfsm->nt = TABLE_NT;
|
||||
<if-start-of-paragraph> equation ... | ==> 0; sfsm->nt = EQUATION_NT;
|
||||
include the ... by ... | ==> 0; sfsm->nt = INCLUDE_NT;
|
||||
include ... by ... | ==> 0; sfsm->nt = INCLUDE_NT;
|
||||
include (- ... ==> 0; sfsm->nt = INFORM6CODE_NT;
|
||||
* | ==> { 0, - }; sfsm->nt = TRACE_NT;
|
||||
* <quoted-text-without-subs> | ==> { 0, - }; sfsm->nt = TRACE_NT;
|
||||
<if-start-of-paragraph> table ... | ==> { 0, - }; sfsm->nt = TABLE_NT;
|
||||
<if-start-of-paragraph> equation ... | ==> { 0, - }; sfsm->nt = EQUATION_NT;
|
||||
include the ... by ... | ==> { 0, - }; sfsm->nt = INCLUDE_NT;
|
||||
include ... by ... | ==> { 0, - }; sfsm->nt = INCLUDE_NT;
|
||||
include (- ... ==> { 0, - }; sfsm->nt = INFORM6CODE_NT;
|
||||
|
||||
@ Rules are ordinarily detected by their colon, which divides the header from the
|
||||
rest: colons are not otherwise legal in Inform. But there's an exception. If the
|
||||
|
@ -305,7 +305,7 @@ sentences. Whereas other nonstructural sentences can wait, these can't.
|
|||
|
||||
=
|
||||
<language-modifying-sentence> ::=
|
||||
include (- ### in the preform grammar | ==> -2; sfsm->nt = INFORM6CODE_NT;
|
||||
include (- ### in the preform grammar | ==> { -2, - }; sfsm->nt = INFORM6CODE_NT;
|
||||
use ... language element/elements ==> { -1, - }
|
||||
|
||||
@ The following callback function is called by //syntax// when it breaks a
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Total memory consumption was 257150K = 251 MB
|
||||
|
||||
62.5% was used for 1344926 objects, in 273456 frames in 201 x 800K = 160800K = 157 MB:
|
||||
62.5% was used for 1344930 objects, in 273460 frames in 201 x 800K = 160800K = 157 MB:
|
||||
|
||||
9.8% inter_tree_node_array 36 x 8192 = 294912 objects, 25953408 bytes
|
||||
5.4% text_stream_array 2570 x 100 = 257000 objects, 14474240 bytes
|
||||
|
@ -20,8 +20,8 @@ Total memory consumption was 257150K = 251 MB
|
|||
0.3% excerpt_meaning 3102 objects, 967824 bytes
|
||||
0.3% inter_name_array 20 x 1000 = 20000 objects, 960640 bytes
|
||||
0.3% inter_package 13201 objects, 950472 bytes
|
||||
0.3% production 3899 objects, 904568 bytes
|
||||
0.3% ptoken 8420 objects, 875680 bytes
|
||||
0.3% production 3901 objects, 905032 bytes
|
||||
0.3% ptoken 8422 objects, 875888 bytes
|
||||
0.3% grammatical_usage 3614 objects, 867360 bytes
|
||||
0.3% individual_form 2564 objects, 861504 bytes
|
||||
0.3% inter_symbols_table 13201 objects, 844864 bytes
|
||||
|
@ -229,5 +229,5 @@ Total memory consumption was 257150K = 251 MB
|
|||
---- emitter array storage 14368 bytes in 8 claims
|
||||
---- code generation workspace for objects 9200 bytes in 9 claims
|
||||
|
||||
20.1% was overhead - 53146680 bytes = 51901K = 50 MB
|
||||
20.1% was overhead - 53146008 bytes = 51900K = 50 MB
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
100.0% in inform7 run
|
||||
66.5% in compilation to Inter
|
||||
24.8% in //Phrases::Manager::compile_first_block//
|
||||
8.8% in //Phrases::Manager::compile_as_needed//
|
||||
7.3% in //Strings::compile_responses//
|
||||
66.8% in compilation to Inter
|
||||
25.0% in //Phrases::Manager::compile_first_block//
|
||||
8.9% in //Phrases::Manager::compile_as_needed//
|
||||
7.2% in //Strings::compile_responses//
|
||||
6.5% in //World::Compile::compile//
|
||||
3.3% in //Assertions::Traverse::traverse1//
|
||||
3.4% in //Assertions::Traverse::traverse1//
|
||||
3.3% in //Sentences::VPs::traverse//
|
||||
2.1% in //Phrases::Manager::RulePrintingRule_routine//
|
||||
2.1% in //Phrases::Manager::rulebooks_array//
|
||||
1.0% in //NewVerbs::ConjugateVerb//
|
||||
2.2% in //Phrases::Manager::RulePrintingRule_routine//
|
||||
1.9% in //Phrases::Manager::rulebooks_array//
|
||||
0.9% in //NewVerbs::ConjugateVerb//
|
||||
0.8% in //Phrases::Manager::traverse//
|
||||
0.5% in //Phrases::Manager::parse_rule_parameters//
|
||||
0.4% in //Phrases::Manager::compile_rulebooks//
|
||||
|
@ -25,11 +25,11 @@
|
|||
0.1% in //Sentences::Rearrangement::tidy_up_ofs_and_froms//
|
||||
0.1% in //Sentences::RuleSubtrees::register_recently_lexed_phrases//
|
||||
0.1% in //World::complete_additions//
|
||||
2.8% not specifically accounted for
|
||||
31.2% in running Inter pipeline
|
||||
2.9% not specifically accounted for
|
||||
30.9% in running Inter pipeline
|
||||
10.6% in step preparation
|
||||
10.2% in inter step 2/12: link
|
||||
7.6% in inter step 12/12: generate inform6 -> auto.inf
|
||||
7.1% in inter step 12/12: generate inform6 -> auto.inf
|
||||
0.3% in inter step 9/12: make-identifiers-unique
|
||||
0.2% in inter step 10/12: reconcile-verbs
|
||||
0.2% in inter step 11/12: eliminate-redundant-labels
|
||||
|
@ -39,6 +39,6 @@
|
|||
0.1% in inter step 4/12: parse-linked-matter
|
||||
0.1% in inter step 5/12: resolve-conditional-compilation
|
||||
0.1% in inter step 8/12: inspect-plugs
|
||||
1.0% not specifically accounted for
|
||||
1.2% not specifically accounted for
|
||||
2.0% in supervisor
|
||||
0.3% not specifically accounted for
|
||||
0.2% not specifically accounted for
|
||||
|
|
|
@ -19,8 +19,8 @@ only valid impure conditions are description noun phrases.
|
|||
|
||||
=
|
||||
<s-condition-uncached> ::=
|
||||
<s-condition-pure> | ==> { pass 1 }
|
||||
<s-descriptive-np> ==> { pass 1 }
|
||||
<s-condition-pure> | ==> { pass 1 }
|
||||
<s-descriptive-np> ==> { pass 1 }
|
||||
|
||||
@ Now for pure conditions. Note that logical "and" and "or" are implemented
|
||||
directly right here, rather than being phrases defined in the Standard Rules,
|
||||
|
@ -28,13 +28,13 @@ and that they aren't the same as the "and" and "or" used a list dividers.
|
|||
|
||||
=
|
||||
<s-condition-pure> ::=
|
||||
( <s-condition-pure> ) | ==> { pass 1 }
|
||||
<s-condition-pure> , and <s-condition-pure> | ==> Conditions::new_LOGICAL_AND(RP[1], RP[2])
|
||||
<s-condition-pure> and <s-condition-pure> | ==> Conditions::new_LOGICAL_AND(RP[1], RP[2])
|
||||
<s-condition-pure> , or <s-condition-pure> | ==> Conditions::new_LOGICAL_OR(RP[1], RP[2])
|
||||
<s-condition-pure> or <s-condition-pure> | ==> Conditions::new_LOGICAL_OR(RP[1], RP[2])
|
||||
<s-condition-with-chronology> | ==> { pass 1 }
|
||||
<s-condition-atomic> ==> { pass 1 }
|
||||
( <s-condition-pure> ) | ==> { pass 1 }
|
||||
<s-condition-pure> , and <s-condition-pure> | ==> { -, Conditions::new_LOGICAL_AND(RP[1], RP[2]) }
|
||||
<s-condition-pure> and <s-condition-pure> | ==> { -, Conditions::new_LOGICAL_AND(RP[1], RP[2]) }
|
||||
<s-condition-pure> , or <s-condition-pure> | ==> { -, Conditions::new_LOGICAL_OR(RP[1], RP[2]) }
|
||||
<s-condition-pure> or <s-condition-pure> | ==> { -, Conditions::new_LOGICAL_OR(RP[1], RP[2]) }
|
||||
<s-condition-with-chronology> | ==> { pass 1 }
|
||||
<s-condition-atomic> ==> { pass 1 }
|
||||
|
||||
@ Chronological restrictions include, for instance,
|
||||
|
||||
|
@ -102,15 +102,15 @@ to other languages may want to find more elegant solutions.
|
|||
|
||||
=
|
||||
<s-condition-atomic> ::=
|
||||
<s-phrase-option-in-use> | ==> { pass 1 }
|
||||
not <s-phrase-option-in-use> | ==> Conditions::negate(RP[1])
|
||||
<s-nonexistential-phrase-to-decide> | ==> { pass 1 }
|
||||
<s-past-action-pattern-as-condition> | ==> { pass 1 }
|
||||
<s-past-action-pattern-as-negated-condition> | ==> Conditions::negate(RP[1])
|
||||
<s-action-pattern-as-condition> | ==> { pass 1 }
|
||||
<s-action-pattern-as-negated-condition> | ==> Conditions::negate(RP[1])
|
||||
<s-sentence> | ==> { pass 1 }
|
||||
<s-existential-phrase-to-decide> ==> { pass 1 }
|
||||
<s-phrase-option-in-use> | ==> { pass 1 }
|
||||
not <s-phrase-option-in-use> | ==> { -, Conditions::negate(RP[1]) }
|
||||
<s-nonexistential-phrase-to-decide> | ==> { pass 1 }
|
||||
<s-past-action-pattern-as-condition> | ==> { pass 1 }
|
||||
<s-past-action-pattern-as-negated-condition> | ==> { -, Conditions::negate(RP[1]) }
|
||||
<s-action-pattern-as-condition> | ==> { pass 1 }
|
||||
<s-action-pattern-as-negated-condition> | ==> { -, Conditions::negate(RP[1]) }
|
||||
<s-sentence> | ==> { pass 1 }
|
||||
<s-existential-phrase-to-decide> ==> { pass 1 }
|
||||
|
||||
@ As before, we try to get better sensitivity to ambiguities by dividing the
|
||||
test for a phrase-to-decide into two, so that the following is used at a
|
||||
|
@ -122,14 +122,14 @@ testing the existence of something.
|
|||
|
||||
=
|
||||
<s-nonexistential-phrase-to-decide> ::=
|
||||
<existential-verb-phrase> | ==> { fail }
|
||||
<s-phrase-to-decide> | ==> { pass 1 }
|
||||
not <s-phrase-to-decide> ==> Conditions::negate(RP[1])
|
||||
<existential-verb-phrase> | ==> { fail }
|
||||
<s-phrase-to-decide> | ==> { pass 1 }
|
||||
not <s-phrase-to-decide> ==> { -, Conditions::negate(RP[1]) }
|
||||
|
||||
<s-existential-phrase-to-decide> ::=
|
||||
^<existential-verb-phrase> | ==> { fail }
|
||||
<s-phrase-to-decide> | ==> { pass 1 }
|
||||
not <s-phrase-to-decide> ==> Conditions::negate(RP[1])
|
||||
^<existential-verb-phrase> | ==> { fail }
|
||||
<s-phrase-to-decide> | ==> { pass 1 }
|
||||
not <s-phrase-to-decide> ==> { -, Conditions::negate(RP[1]) }
|
||||
|
||||
<existential-verb-phrase> ::=
|
||||
<np-existential> is/are ...
|
||||
|
@ -170,10 +170,10 @@ is handled. The following nonterminal exists to enter the AP to the meaning list
|
|||
|
||||
=
|
||||
<s-action-pattern-as-condition> ::=
|
||||
<we-are-action-pattern> ==> Conditions::new_TEST_ACTION(RP[1], W);
|
||||
<we-are-action-pattern> ==> { -, Conditions::new_TEST_ACTION(RP[1], W) }
|
||||
|
||||
<s-action-pattern-as-negated-condition> ::=
|
||||
<action-pattern-negated> ==> Conditions::new_TEST_ACTION(RP[1], W);
|
||||
<action-pattern-negated> ==> { -, Conditions::new_TEST_ACTION(RP[1], W) }
|
||||
|
||||
@ And similarly:
|
||||
|
||||
|
@ -216,22 +216,22 @@ typechecking to choose between much later on.
|
|||
|
||||
=
|
||||
<s-command> ::=
|
||||
( <s-command> ) | ==> { pass 1 }
|
||||
<s-to-phrase> ==> { pass 1 }
|
||||
( <s-command> ) | ==> { pass 1 }
|
||||
<s-to-phrase> ==> { pass 1 }
|
||||
|
||||
<s-say-command> ::=
|
||||
( <s-say-command> ) | ==> { pass 1 }
|
||||
<s-adaptive-text> | ==> { pass 1 }
|
||||
<s-text-substitution> ==> { pass 1 }
|
||||
( <s-say-command> ) | ==> { pass 1 }
|
||||
<s-adaptive-text> | ==> { pass 1 }
|
||||
<s-text-substitution> ==> { pass 1 }
|
||||
|
||||
<s-adaptive-text> ::=
|
||||
<s-local-variable> | ==> { fail }
|
||||
<adaptive-verb> verb | ==> ExParser::say_verb(RP[1], R[1], NULL, W)
|
||||
<adaptive-adjective> adjective | ==> ExParser::say_adjective(RP[1], W)
|
||||
<adaptive-verb> | ==> ExParser::say_verb(RP[1], R[1], NULL, W)
|
||||
<modal-verb> <adaptive-verb-infinitive> verb | ==> @<Annotate the verb with a modal@>
|
||||
<modal-verb> <adaptive-verb-infinitive> | ==> @<Annotate the verb with a modal@>
|
||||
<adaptive-adjective> ==> ExParser::say_adjective(RP[1], W)
|
||||
<s-local-variable> | ==> { fail }
|
||||
<adaptive-verb> verb | ==> { -, ExParser::say_verb(RP[1], R[1], NULL, W) }
|
||||
<adaptive-adjective> adjective | ==> { -, ExParser::say_adjective(RP[1], W) }
|
||||
<adaptive-verb> | ==> { -, ExParser::say_verb(RP[1], R[1], NULL, W) }
|
||||
<modal-verb> <adaptive-verb-infinitive> verb | ==> @<Annotate the verb with a modal@>
|
||||
<modal-verb> <adaptive-verb-infinitive> | ==> @<Annotate the verb with a modal@>
|
||||
<adaptive-adjective> ==> { -, ExParser::say_adjective(RP[1], W) }
|
||||
|
||||
@ "To..." phrases are easy, or at least, easy to delegate:
|
||||
|
||||
|
|
|
@ -14,13 +14,13 @@ is on the table". For now, though, we treat it as a noun.
|
|||
|
||||
=
|
||||
<s-constant-value> ::=
|
||||
<s-literal> | ==> { pass 1 }
|
||||
nothing | ==> Rvalues::new_nothing_object_constant();
|
||||
<s-miscellaneous-proper-noun> | ==> { pass 1 }
|
||||
<s-rulebook-outcome-name> outcome | ==> { pass 1 }
|
||||
<s-use-option-name> option | ==> { pass 1 }
|
||||
verb <instance-of-verb> | ==> @<Compose verb ML@>
|
||||
<s-rule-name> response ( <response-letter> ) ==> @<Compose response ML@>
|
||||
<s-literal> | ==> { pass 1 }
|
||||
nothing | ==> { -, Rvalues::new_nothing_object_constant() }
|
||||
<s-miscellaneous-proper-noun> | ==> { pass 1 }
|
||||
<s-rulebook-outcome-name> outcome | ==> { pass 1 }
|
||||
<s-use-option-name> option | ==> { pass 1 }
|
||||
verb <instance-of-verb> | ==> @<Compose verb ML@>
|
||||
<s-rule-name> response ( <response-letter> ) ==> @<Compose response ML@>
|
||||
|
||||
@<Compose verb ML@> =
|
||||
verb_form *vf = (verb_form *) (RP[1]);
|
||||
|
@ -172,7 +172,7 @@ is read as if it were "scenery thing".
|
|||
|
||||
=
|
||||
<s-adjective-list-as-desc> ::=
|
||||
<s-adjective-list> ==> Node::AdjectiveLists::add_adjlist(Descriptions::from_proposition(NULL, W), RP[1])
|
||||
<s-adjective-list> ==> { -, Node::AdjectiveLists::add_adjlist(Descriptions::from_proposition(NULL, W), RP[1]) }
|
||||
|
||||
@ So now we test whether an excerpt is a list of adjectives; for example,
|
||||
this matches
|
||||
|
@ -232,15 +232,15 @@ the chimp is either not hairy or not an animal.
|
|||
|
||||
=
|
||||
<s-adjective-list> ::=
|
||||
not <indefinite-article> <s-adjective-list-unarticled> | ==> 0; *XP = Node::AdjectiveLists::make_adjlist(Node::AdjectiveLists::negate_adjlist(RP[2]), W)
|
||||
<indefinite-article> <s-adjective-list-unarticled> | ==> 0; *XP = Node::AdjectiveLists::make_adjlist(RP[2], W)
|
||||
<s-adjective-list-unarticled> ==> 0; *XP = Node::AdjectiveLists::make_adjlist(RP[1], W)
|
||||
not <indefinite-article> <s-adjective-list-unarticled> | ==> { 0, Node::AdjectiveLists::make_adjlist(Node::AdjectiveLists::negate_adjlist(RP[2]), W) }
|
||||
<indefinite-article> <s-adjective-list-unarticled> | ==> { 0, Node::AdjectiveLists::make_adjlist(RP[2], W) }
|
||||
<s-adjective-list-unarticled> ==> { 0, Node::AdjectiveLists::make_adjlist(RP[1], W) }
|
||||
|
||||
<s-adjective-list-unarticled> ::=
|
||||
not <s-adjective> | ==> 0; *XP = Node::AdjectiveLists::negate_adjlist(RP[1])
|
||||
<s-adjective> | ==> { 0, RP[1] }
|
||||
not <s-adjective> <s-adjective-list-unarticled> | ==> 0; *XP = Node::AdjectiveLists::join_adjlist(Node::AdjectiveLists::negate_adjlist(RP[1]), RP[2])
|
||||
<s-adjective> <s-adjective-list-unarticled> ==> 0; *XP = Node::AdjectiveLists::join_adjlist(RP[1], RP[2])
|
||||
not <s-adjective> | ==> { 0, Node::AdjectiveLists::negate_adjlist(RP[1]) }
|
||||
<s-adjective> | ==> { 0, RP[1] }
|
||||
not <s-adjective> <s-adjective-list-unarticled> | ==> { 0, Node::AdjectiveLists::join_adjlist(Node::AdjectiveLists::negate_adjlist(RP[1]), RP[2]) }
|
||||
<s-adjective> <s-adjective-list-unarticled> ==> { 0, Node::AdjectiveLists::join_adjlist(RP[1], RP[2]) }
|
||||
|
||||
@ That reduces us to an internal nonterminal, which matches the longest
|
||||
possible adjective name it can see.
|
||||
|
@ -352,14 +352,14 @@ them with conditions like
|
|||
|
||||
=
|
||||
<s-qualifiable-noun> ::=
|
||||
<k-kind> | ==> Specifications::from_kind(RP[1]); s_adj_domain = RP[1];
|
||||
<s-instance-name> ==> RP[1]; s_adj_domain = NULL;
|
||||
<k-kind> | ==> { -, Specifications::from_kind(RP[1]) }; s_adj_domain = RP[1];
|
||||
<s-instance-name> ==> { -, RP[1] }; s_adj_domain = NULL;
|
||||
|
||||
<s-qualifiable-common-noun> ::=
|
||||
<k-kind> ==> Specifications::from_kind(RP[1]); s_adj_domain = RP[1];
|
||||
<k-kind> ==> { -, Specifications::from_kind(RP[1]) }; s_adj_domain = RP[1];
|
||||
|
||||
<s-qualifiable-proper-noun> ::=
|
||||
<s-instance-name> ==> RP[1]; s_adj_domain = NULL;
|
||||
<s-instance-name> ==> { -, RP[1] }; s_adj_domain = NULL;
|
||||
|
||||
@ <s-instance-name> parses text exactly as if it were <instance-of-object>, but
|
||||
is just a little faster written as an internal like this.
|
||||
|
@ -388,7 +388,7 @@ whereas "empty rulebook" will work.
|
|||
|
||||
=
|
||||
<s-applicable-adjective-list> ::=
|
||||
<s-adjective-list> ==> RP[1]; if ((s_adj_domain) && (Node::AdjectiveLists::adjlist_applies_to_kind(RP[1], s_adj_domain) == FALSE)) return FALSE;
|
||||
<s-adjective-list> ==> { -, RP[1] }; if ((s_adj_domain) && (Node::AdjectiveLists::adjlist_applies_to_kind(RP[1], s_adj_domain) == FALSE)) return FALSE;
|
||||
|
||||
@h Descriptions.
|
||||
In most programming languages, commands are like imperative verbs, but their
|
||||
|
@ -444,37 +444,38 @@ In the grammar for <s-description>, the noun is compulsory.
|
|||
|
||||
=
|
||||
<s-description> ::=
|
||||
<s-description-uncomposite-inner> | ==> { pass 1 }
|
||||
<s-np-with-relative-clause> ==> { pass 1 }
|
||||
<s-description-uncomposite-inner> | ==> { pass 1 }
|
||||
<s-np-with-relative-clause> ==> { pass 1 }
|
||||
|
||||
<s-description-uncomposite> ::=
|
||||
<s-description-uncomposite-inner> ==> { pass 1 }
|
||||
<s-description-uncomposite-inner> ==> { pass 1 }
|
||||
|
||||
<s-description-uncomposite-inner> ::=
|
||||
<s-description-uncalled> ( called <s-calling-name> ) | ==> @<Glue on the calling ML@>
|
||||
<s-description-uncalled> ==> { pass 1 }
|
||||
<s-description-uncalled> ( called <s-calling-name> ) | ==> @<Glue on the calling ML@>
|
||||
<s-description-uncalled> ==> { pass 1 }
|
||||
|
||||
<s-description-uncalled> ::=
|
||||
<s-specifier> <s-description-unspecified> | ==> @<Glue on the quantification ML@>
|
||||
<s-specifying-noun> | ==> { pass 1 }
|
||||
<s-specifying-noun> <s-adjective-list> | ==> Node::AdjectiveLists::add_adjlist_w(RP[1], RP[2])
|
||||
<if-trying-omission-permitted> <definite-article> <s-common-description-unspecified> | ==> { pass 3 }
|
||||
^<if-trying-omission-permitted> ^<if-multiplicitous> <definite-article> <s-common-description-unspecified> | ==> @<Issue PM_DefiniteCommonNoun problem@>
|
||||
<definite-article> <s-proper-description-unspecified> | ==> { pass 2 }
|
||||
<indefinite-article> <s-description-unspecified> | ==> { pass 2 }
|
||||
<s-description-unspecified> ==> { pass 1 }
|
||||
<s-specifier> <s-description-unspecified> | ==> @<Glue on the quantification ML@>
|
||||
<s-specifying-noun> | ==> { pass 1 }
|
||||
<s-specifying-noun> <s-adjective-list> | ==> { -, Node::AdjectiveLists::add_adjlist_w(RP[1], RP[2]) }
|
||||
<if-trying-omission-permitted> <definite-article> <s-common-description-unspecified> | ==> { pass 3 }
|
||||
^<if-trying-omission-permitted> ^<if-multiplicitous> <definite-article> <s-common-description-unspecified> | ==> @<Issue PM_DefiniteCommonNoun problem@>
|
||||
<definite-article> <s-proper-description-unspecified> | ==> { pass 2 }
|
||||
<indefinite-article> <s-description-unspecified> | ==> { pass 2 }
|
||||
<s-description-unspecified> ==> { pass 1 }
|
||||
|
||||
<s-description-unspecified> ::=
|
||||
<s-qualifiable-noun> | ==> { pass 1 }
|
||||
<s-applicable-adjective-list> <s-qualifiable-noun> ==> Node::AdjectiveLists::add_adjlist(RP[2], RP[1])
|
||||
<s-qualifiable-noun> | ==> { pass 1 }
|
||||
<s-applicable-adjective-list> <s-qualifiable-noun> ==> { -, Node::AdjectiveLists::add_adjlist(RP[2], RP[1]) }
|
||||
|
||||
<s-common-description-unspecified> ::=
|
||||
<s-qualifiable-common-noun> | ==> { pass 1 }
|
||||
<s-applicable-adjective-list> <s-qualifiable-common-noun> ==> Node::AdjectiveLists::add_adjlist(RP[2], RP[1])
|
||||
<s-qualifiable-common-noun> | ==> { pass 1 }
|
||||
<s-applicable-adjective-list> <s-qualifiable-common-noun> ==> { -, Node::AdjectiveLists::add_adjlist(RP[2], RP[1]) }
|
||||
|
||||
<s-proper-description-unspecified> ::=
|
||||
<s-qualifiable-proper-noun> | ==> { pass 1 }
|
||||
<s-applicable-adjective-list> <s-qualifiable-proper-noun> ==> Node::AdjectiveLists::add_adjlist(RP[2], RP[1])
|
||||
<s-qualifiable-proper-noun> | ==> { pass 1 }
|
||||
<s-applicable-adjective-list> <s-qualifiable-proper-noun> ==> { -, Node::AdjectiveLists::add_adjlist(RP[2], RP[1]) }
|
||||
|
||||
|
||||
<if-trying-omission-permitted> internal 0 {
|
||||
#ifdef IF_MODULE
|
||||
|
@ -493,27 +494,27 @@ except that the noun is optional. The only difference is right at the bottom.
|
|||
|
||||
=
|
||||
<s-description-nounless> ::=
|
||||
<s-description-nounless-uncomposite> | ==> { pass 1 }
|
||||
<s-np-with-relative-clause> ==> { pass 1 }
|
||||
<s-description-nounless-uncomposite> | ==> { pass 1 }
|
||||
<s-np-with-relative-clause> ==> { pass 1 }
|
||||
|
||||
<s-description-nounless-uncomposite> ::=
|
||||
<s-description-nounless-uncalled> ( called <s-calling-name> ) | ==> @<Glue on the calling ML@>
|
||||
<s-description-nounless-uncalled> ==> { pass 1 }
|
||||
<s-description-nounless-uncalled> ( called <s-calling-name> ) | ==> @<Glue on the calling ML@>
|
||||
<s-description-nounless-uncalled> ==> { pass 1 }
|
||||
|
||||
<s-description-nounless-uncalled> ::=
|
||||
<s-specifier> <s-description-nounless-unspecified> | ==> @<Glue on the quantification ML@>
|
||||
<s-specifying-noun> | ==> { pass 1 }
|
||||
<s-specifying-noun> <s-adjective-list> | ==> Node::AdjectiveLists::add_adjlist_w(RP[1], RP[2])
|
||||
<if-trying-omission-permitted> <definite-article> <s-common-description-unspecified> | ==> { pass 3 }
|
||||
^<if-trying-omission-permitted> ^<if-multiplicitous> <definite-article> <s-common-description-unspecified> | ==> @<Issue PM_DefiniteCommonNoun problem@>
|
||||
<indefinite-article> <s-description-nounless-unspecified> | ==> { pass 2 }
|
||||
<definite-article> <s-proper-description-unspecified> | ==> { pass 2 }
|
||||
<s-description-nounless-unspecified> ==> { pass 1 }
|
||||
<s-specifier> <s-description-nounless-unspecified> | ==> @<Glue on the quantification ML@>
|
||||
<s-specifying-noun> | ==> { pass 1 }
|
||||
<s-specifying-noun> <s-adjective-list> | ==> { -, Node::AdjectiveLists::add_adjlist_w(RP[1], RP[2]) }
|
||||
<if-trying-omission-permitted> <definite-article> <s-common-description-unspecified> | ==> { pass 3 }
|
||||
^<if-trying-omission-permitted> ^<if-multiplicitous> <definite-article> <s-common-description-unspecified> | ==> @<Issue PM_DefiniteCommonNoun problem@>
|
||||
<indefinite-article> <s-description-nounless-unspecified> | ==> { pass 2 }
|
||||
<definite-article> <s-proper-description-unspecified> | ==> { pass 2 }
|
||||
<s-description-nounless-unspecified> ==> { pass 1 }
|
||||
|
||||
<s-description-nounless-unspecified> ::=
|
||||
<s-qualifiable-noun> | ==> { pass 1 }
|
||||
<s-applicable-adjective-list> <s-qualifiable-noun> | ==> Node::AdjectiveLists::add_adjlist(RP[2], RP[1])
|
||||
<s-adjective-list> ==> Node::AdjectiveLists::add_adjlist(Descriptions::from_proposition(NULL, W), RP[1])
|
||||
<s-qualifiable-noun> | ==> { pass 1 }
|
||||
<s-applicable-adjective-list> <s-qualifiable-noun> | ==> { -, Node::AdjectiveLists::add_adjlist(RP[2], RP[1]) }
|
||||
<s-adjective-list> ==> { -, Node::AdjectiveLists::add_adjlist(Descriptions::from_proposition(NULL, W), RP[1]) }
|
||||
|
||||
@<Glue on the calling ML@> =
|
||||
parse_node *p = RP[1];
|
||||
|
@ -590,8 +591,8 @@ context of a proper noun, as in "some tea", because it may be confusion of
|
|||
|
||||
=
|
||||
<s-calling-name> ::=
|
||||
<article> ... | ==> Node::new_with_words(UNKNOWN_NT, WR[1])
|
||||
... ==> Node::new_with_words(UNKNOWN_NT, WR[1])
|
||||
<article> ... | ==> { -, Node::new_with_words(UNKNOWN_NT, WR[1]) }
|
||||
... ==> { -, Node::new_with_words(UNKNOWN_NT, WR[1]) }
|
||||
|
||||
@ The following is written as an internal, voracious nonterminal for speed.
|
||||
It matches text like
|
||||
|
|
|
@ -16,16 +16,16 @@ Note that ordinal numbers are not valid as literals: "2nd" is not a noun.
|
|||
|
||||
=
|
||||
<s-literal> ::=
|
||||
<cardinal-number> | ==> Rvalues::from_int(R[1], W)
|
||||
minus <cardinal-number> | ==> Rvalues::from_int(-R[1], W)
|
||||
<quoted-text> ( <response-letter> ) | ==> Rvalues::from_wording(W)
|
||||
<quoted-text> | ==> Rvalues::from_wording(W)
|
||||
<s-literal-real-number> | ==> { pass 1 }
|
||||
<s-literal-truth-state> | ==> { pass 1 }
|
||||
<s-literal-list> | ==> { pass 1 }
|
||||
unicode <s-unicode-character> | ==> { pass 1 }
|
||||
<s-literal-time> | ==> { pass 1 }
|
||||
<s-literal-unit-notation> ==> { pass 1 }
|
||||
<cardinal-number> | ==> { -, Rvalues::from_int(R[1], W) }
|
||||
minus <cardinal-number> | ==> { -, Rvalues::from_int(-R[1], W) }
|
||||
<quoted-text> ( <response-letter> ) | ==> { -, Rvalues::from_wording(W) }
|
||||
<quoted-text> | ==> { -, Rvalues::from_wording(W) }
|
||||
<s-literal-real-number> | ==> { pass 1 }
|
||||
<s-literal-truth-state> | ==> { pass 1 }
|
||||
<s-literal-list> | ==> { pass 1 }
|
||||
unicode <s-unicode-character> | ==> { pass 1 }
|
||||
<s-literal-time> | ==> { pass 1 }
|
||||
<s-literal-unit-notation> ==> { pass 1 }
|
||||
|
||||
<s-literal-unit-notation> internal {
|
||||
literal_pattern *lp;
|
||||
|
@ -59,8 +59,8 @@ in principle be any number of people, colours, vehicles, and such.
|
|||
|
||||
=
|
||||
<s-literal-truth-state> ::=
|
||||
false | ==> Rvalues::from_boolean(FALSE, W)
|
||||
true ==> Rvalues::from_boolean(TRUE, W)
|
||||
false | ==> { -, Rvalues::from_boolean(FALSE, W) }
|
||||
true ==> { -, Rvalues::from_boolean(TRUE, W) }
|
||||
|
||||
@ The problem message for engineering notation should only appear once:
|
||||
|
||||
|
@ -75,11 +75,11 @@ Still:
|
|||
|
||||
=
|
||||
<s-literal-real-number> ::=
|
||||
_ pi | ==> Rvalues::from_IEEE_754(0x40490FDB, W)
|
||||
_ e | ==> Rvalues::from_IEEE_754(0x402DF854, W)
|
||||
plus infinity | ==> Rvalues::from_IEEE_754(0x7F800000, W)
|
||||
minus infinity | ==> Rvalues::from_IEEE_754(0xFF800000, W)
|
||||
<literal-real-in-digits> ==> Rvalues::from_IEEE_754((unsigned int) R[1], W)
|
||||
_ pi | ==> { -, Rvalues::from_IEEE_754(0x40490FDB, W) }
|
||||
_ e | ==> { -, Rvalues::from_IEEE_754(0x402DF854, W) }
|
||||
plus infinity | ==> { -, Rvalues::from_IEEE_754(0x7F800000, W) }
|
||||
minus infinity | ==> { -, Rvalues::from_IEEE_754(0xFF800000, W) }
|
||||
<literal-real-in-digits> ==> { -, Rvalues::from_IEEE_754((unsigned int) R[1], W) }
|
||||
|
||||
<literal-real-in-digits> internal {
|
||||
if ((Wordings::length(W) != 1) && (Wordings::length(W) != 3)) return FALSE;
|
||||
|
|
|
@ -54,18 +54,18 @@ type representing only its own value.
|
|||
|
||||
=
|
||||
<s-type-expression-uncached> ::=
|
||||
<article> <s-type-expression-unarticled> | ==> { pass 2 }
|
||||
<s-type-expression-unarticled> ==> { pass 1 }
|
||||
<article> <s-type-expression-unarticled> | ==> { pass 2 }
|
||||
<s-type-expression-unarticled> ==> { pass 1 }
|
||||
|
||||
<s-type-expression-unarticled> ::=
|
||||
<s-variable-scope> variable/variables | ==> { pass 1 }
|
||||
<s-variable-scope> that/which vary/varies | ==> { pass 1 }
|
||||
<k-kind> | ==> Specifications::from_kind(RP[1])
|
||||
<s-literal> | ==> { pass 1 }
|
||||
<s-constant-value> | ==> { pass 1 }
|
||||
<s-description-uncomposite> | ==> { pass 1 }
|
||||
<s-action-pattern-as-value> | ==> { pass 1 }
|
||||
<s-description> ==> { pass 1 }
|
||||
<s-variable-scope> variable/variables | ==> { pass 1 }
|
||||
<s-variable-scope> that/which vary/varies | ==> { pass 1 }
|
||||
<k-kind> | ==> { -, Specifications::from_kind(RP[1]) }
|
||||
<s-literal> | ==> { pass 1 }
|
||||
<s-constant-value> | ==> { pass 1 }
|
||||
<s-description-uncomposite> | ==> { pass 1 }
|
||||
<s-action-pattern-as-value> | ==> { pass 1 }
|
||||
<s-description> ==> { pass 1 }
|
||||
|
||||
@ Note that a list of adjectives with no noun does not qualify as a type
|
||||
expression. It looks as if it never should, on the face of it -- "opaque"
|
||||
|
@ -81,12 +81,12 @@ To allow this, we have a minor variation:
|
|||
|
||||
=
|
||||
<s-descriptive-type-expression-uncached> ::=
|
||||
<article> <s-descriptive-type-expression-unarticled> | ==> { pass 2 }
|
||||
<s-descriptive-type-expression-unarticled> ==> { pass 1 }
|
||||
<article> <s-descriptive-type-expression-unarticled> | ==> { pass 2 }
|
||||
<s-descriptive-type-expression-unarticled> ==> { pass 1 }
|
||||
|
||||
<s-descriptive-type-expression-unarticled> ::=
|
||||
<s-adjective-list-as-desc> | ==> { pass 1 }
|
||||
<s-type-expression-unarticled> ==> { pass 1 }
|
||||
<s-type-expression-unarticled> ==> { pass 1 }
|
||||
|
||||
@ And now we parse descriptions of variables such as the one appearing in
|
||||
|
||||
|
@ -102,16 +102,16 @@ higher up in Inform. Ultimately, the text must match <k-kind> in each case.
|
|||
|
||||
=
|
||||
<s-variable-scope> ::=
|
||||
global | ==> Specifications::new_new_variable_like(NULL)
|
||||
global <s-variable-contents> | ==> { pass 1 }
|
||||
<s-variable-contents> ==> { pass 1 }
|
||||
global | ==> { -, Specifications::new_new_variable_like(NULL) }
|
||||
global <s-variable-contents> | ==> { pass 1 }
|
||||
<s-variable-contents> ==> { pass 1 }
|
||||
|
||||
<s-variable-contents> ::=
|
||||
<k-kind> | ==> Specifications::new_new_variable_like(RP[1])
|
||||
<s-literal> | ==> @<Issue PM_TypeCantVary problem@>
|
||||
<s-constant-value> | ==> @<Issue PM_TypeCantVary problem@>
|
||||
<s-description-uncomposite> | ==> @<Issue PM_TypeUnmaintainable problem@>
|
||||
<s-description> ==> @<Issue PM_TypeUnmaintainable problem@>
|
||||
<k-kind> | ==> { -, Specifications::new_new_variable_like(RP[1]) }
|
||||
<s-literal> | ==> @<Issue PM_TypeCantVary problem@>
|
||||
<s-constant-value> | ==> @<Issue PM_TypeCantVary problem@>
|
||||
<s-description-uncomposite> | ==> @<Issue PM_TypeUnmaintainable problem@>
|
||||
<s-description> ==> @<Issue PM_TypeUnmaintainable problem@>
|
||||
|
||||
@<Issue PM_TypeCantVary problem@> =
|
||||
Problems::quote_source(1, current_sentence);
|
||||
|
@ -237,26 +237,26 @@ membership, which is to say, really just a syntactic difference.
|
|||
|
||||
=
|
||||
<s-value-uncached> ::=
|
||||
( <s-value-uncached> ) | ==> { pass 1 }
|
||||
<s-variable> | ==> ExParser::val(RP[1], W)
|
||||
<if-table-column-expected> <s-table-column-name> | ==> ExParser::val(RP[2], W)
|
||||
<if-property-name-expected> <s-property-name> | ==> ExParser::val(RP[2], W)
|
||||
<s-constant-value> | ==> ExParser::val(RP[1], W)
|
||||
<s-equation-usage> | ==> { pass 1 }
|
||||
<s-property-name> | ==> ExParser::val(RP[1], W)
|
||||
<s-action-pattern-as-value> | ==> ExParser::val(RP[1], W)
|
||||
<s-value-phrase-non-of> | ==> ExParser::val(RP[1], W)
|
||||
<s-adjective-list-as-desc> | ==> ExParser::val(RP[1], W)
|
||||
<s-purely-physical-description> | ==> ExParser::val(RP[1], W)
|
||||
<s-table-reference> | ==> ExParser::val(RP[1], W)
|
||||
member/members of <s-description> | ==> ExParser::val(RP[1], W)
|
||||
member/members of <s-local-variable> | ==> ExParser::val(RP[1], W)
|
||||
<s-property-name> of <s-value-uncached> | ==> @<Make a belonging-to-V property@>
|
||||
<if-pronoun-present> <possessive-third-person> <s-property-name> | ==> @<Make a belonging-to-it property@>
|
||||
entry <s-value-uncached> of/in/from <s-value-uncached> | ==> @<Make a list entry@>
|
||||
<s-description> | ==> ExParser::val(RP[1], W)
|
||||
<s-table-column-name> | ==> ExParser::val(RP[1], W)
|
||||
<s-value-phrase> ==> ExParser::val(RP[1], W)
|
||||
( <s-value-uncached> ) | ==> { pass 1 }
|
||||
<s-variable> | ==> { -, ExParser::val(RP[1], W) }
|
||||
<if-table-column-expected> <s-table-column-name> | ==> { -, ExParser::val(RP[2], W) }
|
||||
<if-property-name-expected> <s-property-name> | ==> { -, ExParser::val(RP[2], W) }
|
||||
<s-constant-value> | ==> { -, ExParser::val(RP[1], W) }
|
||||
<s-equation-usage> | ==> { pass 1 }
|
||||
<s-property-name> | ==> { -, ExParser::val(RP[1], W) }
|
||||
<s-action-pattern-as-value> | ==> { -, ExParser::val(RP[1], W) }
|
||||
<s-value-phrase-non-of> | ==> { -, ExParser::val(RP[1], W) }
|
||||
<s-adjective-list-as-desc> | ==> { -, ExParser::val(RP[1], W) }
|
||||
<s-purely-physical-description> | ==> { -, ExParser::val(RP[1], W) }
|
||||
<s-table-reference> | ==> { -, ExParser::val(RP[1], W) }
|
||||
member/members of <s-description> | ==> { -, ExParser::val(RP[1], W) }
|
||||
member/members of <s-local-variable> | ==> { -, ExParser::val(RP[1], W) }
|
||||
<s-property-name> of <s-value-uncached> | ==> @<Make a belonging-to-V property@>
|
||||
<if-pronoun-present> <possessive-third-person> <s-property-name> | ==> @<Make a belonging-to-it property@>
|
||||
entry <s-value-uncached> of/in/from <s-value-uncached> | ==> @<Make a list entry@>
|
||||
<s-description> | ==> { -, ExParser::val(RP[1], W) }
|
||||
<s-table-column-name> | ==> { -, ExParser::val(RP[1], W) }
|
||||
<s-value-phrase> ==> { -, ExParser::val(RP[1], W) }
|
||||
|
||||
@ =
|
||||
parse_node *ExParser::val(parse_node *v, wording W) {
|
||||
|
@ -266,9 +266,9 @@ parse_node *ExParser::val(parse_node *v, wording W) {
|
|||
|
||||
@ =
|
||||
<s-equation-usage> ::=
|
||||
<if-let-equation-mode> <s-plain-text-with-equals> where <s-plain-text> | ==> @<Make an equation@>
|
||||
<s-value-uncached> where <s-plain-text> | ==> @<Make an equation, if the kinds are right@>
|
||||
<if-let-equation-mode> <s-plain-text-with-equals> ==> @<Make an inline equation@>
|
||||
<if-let-equation-mode> <s-plain-text-with-equals> where <s-plain-text> | ==> @<Make an equation@>
|
||||
<s-value-uncached> where <s-plain-text> | ==> @<Make an equation, if the kinds are right@>
|
||||
<if-let-equation-mode> <s-plain-text-with-equals> ==> @<Make an inline equation@>
|
||||
|
||||
@<Make an equation@> =
|
||||
equation *eqn = Equations::new(Node::get_text((parse_node *) RP[2]), TRUE);
|
||||
|
@ -341,18 +341,18 @@ the text "grand total" is parsed as the local.
|
|||
|
||||
=
|
||||
<s-variable> ::=
|
||||
<definite-article> <s-variable> | ==> { pass 2 }
|
||||
<s-local-variable> | ==> { pass 1 }
|
||||
<s-stacked-variable> | ==> { pass 1 }
|
||||
<s-global-variable> ==> { pass 1 }
|
||||
<definite-article> <s-variable> | ==> { pass 2 }
|
||||
<s-local-variable> | ==> { pass 1 }
|
||||
<s-stacked-variable> | ==> { pass 1 }
|
||||
<s-global-variable> ==> { pass 1 }
|
||||
|
||||
<s-nonglobal-variable> ::=
|
||||
( <s-nonglobal-variable> ) | ==> { pass 1 }
|
||||
<s-local-variable> | ==> ExParser::val(RP[1], W)
|
||||
<s-stacked-variable> ==> ExParser::val(RP[1], W)
|
||||
( <s-nonglobal-variable> ) | ==> { pass 1 }
|
||||
<s-local-variable> | ==> { -, ExParser::val(RP[1], W) }
|
||||
<s-stacked-variable> ==> { -, ExParser::val(RP[1], W) }
|
||||
|
||||
<s-variable-as-value> ::=
|
||||
<s-variable> ==> ExParser::val(RP[1], W)
|
||||
<s-variable> ==> { -, ExParser::val(RP[1], W) }
|
||||
|
||||
@ This requires three internals:
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ placeholder to stand for a missing noun phrase:
|
|||
<s-noun-phrase> <s-general-verb-tail> ==> @<Make SV@>;
|
||||
|
||||
<s-existential-verb-tail> ::=
|
||||
<copular-verb> <s-noun-phrase-nounless> ==> ExParser::Subtrees::verb_marker(RP[1], NULL, RP[2])
|
||||
<copular-verb> <s-noun-phrase-nounless> ==> { -, ExParser::Subtrees::verb_marker(RP[1], NULL, RP[2]) }
|
||||
|
||||
@<Make SV@> =
|
||||
ExParser::Subtrees::correct_for_adjectives(RP[1], RP[2]);
|
||||
|
@ -85,9 +85,9 @@ handle its extra object: see below.
|
|||
|
||||
=
|
||||
<s-general-verb-tail> ::=
|
||||
<universal-verb> <s-universal-relation-term> | ==> ExParser::Subtrees::verb_marker(RP[1], NULL, RP[2])
|
||||
<meaningful-nonimperative-verb> <permitted-preposition> <s-noun-phrase> | ==> ExParser::Subtrees::verb_marker(RP[1], RP[2], RP[3])
|
||||
<meaningful-nonimperative-verb> <s-noun-phrase> ==> ExParser::Subtrees::verb_marker(RP[1], NULL, RP[2])
|
||||
<universal-verb> <s-universal-relation-term> | ==> { -, ExParser::Subtrees::verb_marker(RP[1], NULL, RP[2]) }
|
||||
<meaningful-nonimperative-verb> <permitted-preposition> <s-noun-phrase> | ==> { -, ExParser::Subtrees::verb_marker(RP[1], RP[2], RP[3]) }
|
||||
<meaningful-nonimperative-verb> <s-noun-phrase> ==> { -, ExParser::Subtrees::verb_marker(RP[1], NULL, RP[2]) }
|
||||
|
||||
@ The verb marker is a temporary node used just to store the verb or preposition
|
||||
usage; it's attached to the tree only briefly before sentence conversion
|
||||
|
@ -114,7 +114,7 @@ works.
|
|||
|
||||
=
|
||||
<s-universal-relation-term> ::=
|
||||
<s-noun-phrase> to <s-noun-phrase> ==> ExParser::val(Rvalues::from_pair(RP[1], RP[2]), W)
|
||||
<s-noun-phrase> to <s-noun-phrase> ==> { -, ExParser::val(Rvalues::from_pair(RP[1], RP[2]), W) }
|
||||
|
||||
@ The following parses a noun phrase with a relative clause, which is
|
||||
syntactically very similar to the case of a sentence. Sometimes the verb is
|
||||
|
@ -136,17 +136,17 @@ relevant noun subtree with a representation of the player-object for those.
|
|||
|
||||
=
|
||||
<s-np-with-relative-clause> ::=
|
||||
<s-noun-phrase-nounless> <s-implied-relative-verb-tail> | ==> @<Make SN@>
|
||||
<s-noun-phrase> <s-relative-verb-tail> ==> @<Make SN@>
|
||||
<s-noun-phrase-nounless> <s-implied-relative-verb-tail> | ==> @<Make SN@>
|
||||
<s-noun-phrase> <s-relative-verb-tail> ==> @<Make SN@>
|
||||
|
||||
<s-implied-relative-verb-tail> ::=
|
||||
<copular-preposition> <s-noun-phrase-nounless> | ==> ExParser::Subtrees::verb_marker(regular_to_be, RP[1], RP[2])
|
||||
not <copular-preposition> <s-noun-phrase-nounless> ==> ExParser::Subtrees::verb_marker(negated_to_be, RP[1], RP[2])
|
||||
<copular-preposition> <s-noun-phrase-nounless> | ==> { -, ExParser::Subtrees::verb_marker(regular_to_be, RP[1], RP[2]) }
|
||||
not <copular-preposition> <s-noun-phrase-nounless> ==> { -, ExParser::Subtrees::verb_marker(negated_to_be, RP[1], RP[2]) }
|
||||
|
||||
<s-relative-verb-tail> ::=
|
||||
<relative-clause-marker> <universal-verb> <s-universal-relation-term> | ==> ExParser::Subtrees::verb_marker(RP[2], NULL, RP[3])
|
||||
<relative-clause-marker> <meaningful-nonimperative-verb> <permitted-preposition> <s-noun-phrase> | ==> ExParser::Subtrees::verb_marker(RP[2], RP[3], RP[4])
|
||||
<relative-clause-marker> <meaningful-nonimperative-verb> <s-noun-phrase> ==> ExParser::Subtrees::verb_marker(RP[2], NULL, RP[3])
|
||||
<relative-clause-marker> <universal-verb> <s-universal-relation-term> | ==> { -, ExParser::Subtrees::verb_marker(RP[2], NULL, RP[3]) }
|
||||
<relative-clause-marker> <meaningful-nonimperative-verb> <permitted-preposition> <s-noun-phrase> | ==> { -, ExParser::Subtrees::verb_marker(RP[2], RP[3], RP[4]) }
|
||||
<relative-clause-marker> <meaningful-nonimperative-verb> <s-noun-phrase> ==> { -, ExParser::Subtrees::verb_marker(RP[2], NULL, RP[3]) }
|
||||
|
||||
@<Make SN@> =
|
||||
LOGIF(MATCHING, "So uncorrectedly RP[1] = $T\n", RP[1]);
|
||||
|
|
|
@ -2396,19 +2396,19 @@ condition caused the trouble:
|
|||
|
||||
=
|
||||
<condition-problem-diagnosis> ::=
|
||||
<condition-problem-part> <condition-problem-part-tail> | ==> R[1] | R[2]
|
||||
<condition-problem-part> ==> { pass 1 }
|
||||
<condition-problem-part> <condition-problem-part-tail> | ==> { R[1] | R[2], - }
|
||||
<condition-problem-part> ==> { pass 1 }
|
||||
|
||||
<condition-problem-part-tail> ::=
|
||||
, and/or <condition-problem-diagnosis> | ==> { pass 1 }
|
||||
,/and/or <condition-problem-diagnosis> ==> { pass 1 }
|
||||
, and/or <condition-problem-diagnosis> | ==> { pass 1 }
|
||||
,/and/or <condition-problem-diagnosis> ==> { pass 1 }
|
||||
|
||||
<condition-problem-part> ::=
|
||||
<s-condition> | ==> 0; @<Quote this-condition-okay segment@>;
|
||||
<s-value> | ==> INVALID_CP_BIT; @<Quote this-condition-value segment@>;
|
||||
... begins/ends | ==> WHENWHILE_CP_BIT+INVALID_CP_BIT; @<Quote scene-begins-or-ends segment@>;
|
||||
when/while *** | ==> WHENWHILE_CP_BIT+INVALID_CP_BIT; @<Quote this-condition-bad segment@>;
|
||||
... ==> INVALID_CP_BIT; @<Quote this-condition-bad segment@>;
|
||||
<s-condition> | ==> { 0, - }; @<Quote this-condition-okay segment@>;
|
||||
<s-value> | ==> { INVALID_CP_BIT, - }; @<Quote this-condition-value segment@>;
|
||||
... begins/ends | ==> { WHENWHILE_CP_BIT+INVALID_CP_BIT, - }; @<Quote scene-begins-or-ends segment@>;
|
||||
when/while *** | ==> { WHENWHILE_CP_BIT+INVALID_CP_BIT, - }; @<Quote this-condition-bad segment@>;
|
||||
... ==> { INVALID_CP_BIT, - }; @<Quote this-condition-bad segment@>;
|
||||
|
||||
@<Quote this-condition-okay segment@> =
|
||||
if (preform_lookahead_mode == FALSE) {
|
||||
|
|
|
@ -52,16 +52,16 @@ isn't expressed in this grammar.
|
|||
|
||||
=
|
||||
<s-literal-list> ::=
|
||||
\{ \} | ==> Rvalues::from_wording_of_list(Lists::kind_of_ll(Lists::empty_literal_list(Wordings::last_word(W)), FALSE), W)
|
||||
\{ <literal-list-contents> \} ==> Rvalues::from_wording_of_list(Lists::kind_of_ll(RP[1], FALSE), W)
|
||||
\{ \} | ==> { -, Rvalues::from_wording_of_list(Lists::kind_of_ll(Lists::empty_literal_list(Wordings::last_word(W)), FALSE), W) }
|
||||
\{ <literal-list-contents> \} ==> { -, Rvalues::from_wording_of_list(Lists::kind_of_ll(RP[1], FALSE), W) }
|
||||
|
||||
<literal-list-contents> ::=
|
||||
<literal-list-entry> , <literal-list-contents> | ==> 0; *XP = Lists::add_to_ll(RP[1], RP[2], W, R[1])
|
||||
<literal-list-entry> ==> 0; *XP = Lists::add_to_ll(RP[1], Lists::empty_literal_list(W), W, R[1])
|
||||
<literal-list-entry> , <literal-list-contents> | ==> { 0, Lists::add_to_ll(RP[1], RP[2], W, R[1]) }
|
||||
<literal-list-entry> ==> { 0, Lists::add_to_ll(RP[1], Lists::empty_literal_list(W), W, R[1]) }
|
||||
|
||||
<literal-list-entry> ::=
|
||||
<s-value> | ==> { FALSE, RP[1] }
|
||||
...... ==> TRUE; *XP = Specifications::new_UNKNOWN(W)
|
||||
<s-value> | ==> { FALSE, RP[1] }
|
||||
...... ==> { TRUE, Specifications::new_UNKNOWN(W) }
|
||||
|
||||
@ The grammar above builds our list structures from the bottom up. They begin
|
||||
with a call to:
|
||||
|
|
|
@ -229,18 +229,18 @@ what looks like text into grammar for parsing.
|
|||
|
||||
=
|
||||
<table-column-heading> ::=
|
||||
( *** ) | ==> @<Issue PM_TableColumnBracketed problem@>
|
||||
<s-table-column-name> ( ... ) | ==> { EXISTING_TC, RP[1] }; <<k1>> = Wordings::first_wn(WR[1]); <<k2>> = Wordings::last_wn(WR[1]);
|
||||
<table-column-heading-unbracketed> ( ... ) | ==> R[1]; if (R[1] != NEW_TC_PROBLEM) *X = NEW_TC_WITH_KIND; <<k1>> = Wordings::first_wn(WR[1]); <<k2>> = Wordings::last_wn(WR[1]);
|
||||
<s-table-column-name> | ==> { EXISTING_TC, RP[1] }; <<k1>> = -1; <<k2>> = -1;
|
||||
<table-column-heading-unbracketed> ==> { pass 1 }
|
||||
( *** ) | ==> @<Issue PM_TableColumnBracketed problem@>
|
||||
<s-table-column-name> ( ... ) | ==> { EXISTING_TC, RP[1] }; <<k1>> = Wordings::first_wn(WR[1]); <<k2>> = Wordings::last_wn(WR[1]);
|
||||
<table-column-heading-unbracketed> ( ... ) | ==> { R[1], - }; if (R[1] != NEW_TC_PROBLEM) *X = NEW_TC_WITH_KIND; <<k1>> = Wordings::first_wn(WR[1]); <<k2>> = Wordings::last_wn(WR[1]);
|
||||
<s-table-column-name> | ==> { EXISTING_TC, RP[1] }; <<k1>> = -1; <<k2>> = -1;
|
||||
<table-column-heading-unbracketed> ==> { pass 1 }
|
||||
|
||||
<table-column-heading-unbracketed> ::=
|
||||
<article> | ==> @<Issue PM_TableColumnArticle problem@>
|
||||
{topic} | ==> { NEW_TC_TOPIC, - }
|
||||
{<property-name>} | ==> { NEW_TC_WITHOUT_KIND, - }
|
||||
{<s-constant-value>} | ==> @<Issue PM_TableColumnAlready problem@>
|
||||
... ==> { NEW_TC_WITHOUT_KIND, - }
|
||||
<article> | ==> @<Issue PM_TableColumnArticle problem@>
|
||||
{topic} | ==> { NEW_TC_TOPIC, - }
|
||||
{<property-name>} | ==> { NEW_TC_WITHOUT_KIND, - }
|
||||
{<s-constant-value>} | ==> @<Issue PM_TableColumnAlready problem@>
|
||||
... ==> { NEW_TC_WITHOUT_KIND, - }
|
||||
|
||||
@<Issue PM_TableColumnArticle problem@> =
|
||||
*X = NEW_TC_PROBLEM;
|
||||
|
|
|
@ -248,16 +248,16 @@ two forms in any case.
|
|||
|
||||
=
|
||||
<table-header> ::=
|
||||
<table-new-name> ( continued ) | ==> TABLE_IS_CONTINUED; <<nameforms>> = R[1]
|
||||
<table-new-name> ( amended ) | ==> TABLE_IS_AMENDED; <<nameforms>> = R[1]
|
||||
<table-new-name> ( replaced ) | ==> TABLE_IS_REPLACED; <<nameforms>> = R[1]
|
||||
<table-new-name> ==> TABLE_IS_NEW; <<nameforms>> = R[1]
|
||||
<table-new-name> ( continued ) | ==> { TABLE_IS_CONTINUED, -, <<nameforms>> = R[1] }
|
||||
<table-new-name> ( amended ) | ==> { TABLE_IS_AMENDED, -, <<nameforms>> = R[1] }
|
||||
<table-new-name> ( replaced ) | ==> { TABLE_IS_REPLACED, -, <<nameforms>> = R[1] }
|
||||
<table-new-name> ==> { TABLE_IS_NEW, -, <<nameforms>> = R[1] }
|
||||
|
||||
<table-new-name> ::=
|
||||
table ... - ... | ==> { TABLE_HAS_NUMBER_AND_NAME, - }
|
||||
table ### | ==> { TABLE_HAS_ONLY_NUMBER, - }
|
||||
table of ... | ==> { TABLE_HAS_ONLY_NAME, - }
|
||||
table ... ==> @<Issue PM_TableMisnamed problem@>
|
||||
table ... - ... | ==> { TABLE_HAS_NUMBER_AND_NAME, - }
|
||||
table ### | ==> { TABLE_HAS_ONLY_NUMBER, - }
|
||||
table of ... | ==> { TABLE_HAS_ONLY_NAME, - }
|
||||
table ... ==> @<Issue PM_TableMisnamed problem@>
|
||||
|
||||
@<Issue PM_TableMisnamed problem@> =
|
||||
*X = TABLE_HAS_ONLY_NAME; /* for recovery */
|
||||
|
@ -284,9 +284,9 @@ Inform's run, when kinds haven't yet been created.
|
|||
|
||||
=
|
||||
<table-footer> ::=
|
||||
*** with <cardinal-number> blank row/rows | ==> R[1]; <<each>> = FALSE
|
||||
*** with ... blank row/rows | ==> 0; <<each>> = NOT_APPLICABLE
|
||||
*** with blank row/rows for each/every ... ==> 0; <<each>> = TRUE
|
||||
*** with <cardinal-number> blank row/rows | ==> { R[1], -, <<each>> = FALSE }
|
||||
*** with ... blank row/rows | ==> { 0, -, <<each>> = NOT_APPLICABLE }
|
||||
*** with blank row/rows for each/every ... ==> { 0, -, <<each>> = TRUE }
|
||||
|
||||
@ So, here goes. We first identify the top line of the table declaration
|
||||
(the "headline"), then set the current sentence to that, even though in
|
||||
|
@ -849,33 +849,29 @@ us issue more contextual problem messages.
|
|||
|
||||
=
|
||||
<table-cell> ::=
|
||||
<table-cell-blank> | ==> @<Make anomalous entry for blank@>
|
||||
<k-kind-articled> | ==> @<Make anomalous entry for kind@>
|
||||
<s-named-constant> | ==> { NAMED_CONSTANT_ENTRY, RP[1] }
|
||||
<s-global-variable> | ==> @<Issue PM_TablePlayerEntry or C20TableVariableEntry problem@>
|
||||
<table-cell-value> | ==> { pass 1 }
|
||||
<list-of-double-quotes> | ==> @<Make anomalous entry for text to be understood@>
|
||||
... ==> @<Issue PM_TableUnknownEntry problem@>
|
||||
<table-cell-blank> | ==> { BLANK_TABLE_ENTRY, Specifications::new_UNKNOWN(W) }
|
||||
<k-kind-articled> | ==> @<Make anomalous entry for kind@>
|
||||
<s-named-constant> | ==> { NAMED_CONSTANT_ENTRY, RP[1] }
|
||||
<s-global-variable> | ==> @<Issue PM_TablePlayerEntry or C20TableVariableEntry problem@>
|
||||
<table-cell-value> | ==> { pass 1 }
|
||||
<list-of-double-quotes> | ==> @<Make anomalous entry for text to be understood@>
|
||||
... ==> @<Issue PM_TableUnknownEntry problem@>
|
||||
|
||||
<table-cell-blank> ::=
|
||||
--
|
||||
|
||||
<table-cell-value> ::=
|
||||
the action of <s-constant-action> | ==> { ACTION_TABLE_ENTRY, RP[1] }
|
||||
<s-constant-action> | ==> { ACTION_TABLE_ENTRY, RP[1] }
|
||||
the action of <s-explicit-action> | ==> @<Issue PM_NonconstantActionInTable problem@>
|
||||
<s-explicit-action> | ==> @<Issue PM_NonconstantActionInTable problem@>
|
||||
<instance-of-non-object> | ==> INSTANCE_TABLE_ENTRY; *XP = Rvalues::from_instance(RP[1])
|
||||
<s-type-expression> ==> { SPEC_TABLE_ENTRY, RP[1] }
|
||||
the action of <s-constant-action> | ==> { ACTION_TABLE_ENTRY, RP[1] }
|
||||
<s-constant-action> | ==> { ACTION_TABLE_ENTRY, RP[1] }
|
||||
the action of <s-explicit-action> | ==> @<Issue PM_NonconstantActionInTable problem@>
|
||||
<s-explicit-action> | ==> @<Issue PM_NonconstantActionInTable problem@>
|
||||
<instance-of-non-object> | ==> { INSTANCE_TABLE_ENTRY, Rvalues::from_instance(RP[1]) }
|
||||
<s-type-expression> ==> { SPEC_TABLE_ENTRY, RP[1] }
|
||||
|
||||
<list-of-double-quotes> ::=
|
||||
<quoted-text> or <list-of-double-quotes> |
|
||||
<quoted-text>
|
||||
|
||||
@<Make anomalous entry for blank@> =
|
||||
*X = BLANK_TABLE_ENTRY;
|
||||
*XP = Specifications::new_UNKNOWN(W);
|
||||
|
||||
@<Make anomalous entry for kind@> =
|
||||
*X = KIND_TABLE_ENTRY;
|
||||
parse_node *new = Specifications::from_kind(RP[1]);
|
||||
|
|
|
@ -380,7 +380,8 @@ mass, too.
|
|||
_,/and <equation-where-list> ==> { 0, - }
|
||||
|
||||
<equation-where-setting-entry> ::=
|
||||
<equation-where-setting> ==> 0; if (!preform_lookahead_mode) Equations::eqn_dec_var(equation_being_declared, Wordings::one_word(eq_symbol_wn), R[1], RP[1]);
|
||||
... | ==> { lookahead }
|
||||
<equation-where-setting> ==> { -, - }; Equations::eqn_dec_var(equation_being_declared, Wordings::one_word(eq_symbol_wn), R[1], RP[1]);
|
||||
|
||||
<equation-where-setting> ::=
|
||||
<equation-symbol> is/are <k-kind> | ==> { EQW_IDENTIFIES_KIND, RP[2] }; eq_symbol_wn = R[1];
|
||||
|
|
|
@ -122,19 +122,19 @@ something"):
|
|||
|
||||
=
|
||||
<activity-sentence-subject> ::=
|
||||
<activity-noted> ( <documentation-symbol> ) | ==> R[1]; <<ds>> = R[2]
|
||||
<activity-noted> -- <documentation-symbol> -- | ==> R[1]; <<ds>> = R[2]
|
||||
<activity-noted> ==> R[1]; <<ds>> = -1;
|
||||
<activity-noted> ( <documentation-symbol> ) | ==> { R[1], -, <<ds>> = R[2] }
|
||||
<activity-noted> -- <documentation-symbol> -- | ==> { R[1], -, <<ds>> = R[2] }
|
||||
<activity-noted> ==> { R[1], -, <<ds>> = -1 }
|
||||
|
||||
<activity-noted> ::=
|
||||
<activity-new-name> ( future action ) | ==> TRUE; <<future>> = TRUE
|
||||
<activity-new-name> ( ... ) | ==> @<Issue PM_ActivityNoteUnknown problem@>
|
||||
<activity-new-name> ==> TRUE; <<future>> = FALSE
|
||||
<activity-new-name> ( future action ) | ==> { TRUE, -, <<future>> = TRUE }
|
||||
<activity-new-name> ( ... ) | ==> @<Issue PM_ActivityNoteUnknown problem@>
|
||||
<activity-new-name> ==> { TRUE, -, <<future>> = FALSE }
|
||||
|
||||
<activity-new-name> ::=
|
||||
... of/for something/anything | ==> 0; <<any>> = TRUE
|
||||
... something/anything | ==> 0; <<any>> = TRUE
|
||||
... ==> 0; <<any>> = FALSE
|
||||
... of/for something/anything | ==> { 0, -, <<any>> = TRUE }
|
||||
... something/anything | ==> { 0, -, <<any>> = TRUE }
|
||||
... ==> { 0, -, <<any>> = FALSE }
|
||||
|
||||
@ Once a new activity has been created, the following is used to make a
|
||||
noun for it; for example, the "announcing activity".
|
||||
|
@ -451,24 +451,24 @@ it mentions no activities.
|
|||
|
||||
=
|
||||
<run-time-context> ::=
|
||||
not <activity-list-unnegated> | ==> { 0, RP[1] }; @<Flip the activity list parities@>;
|
||||
<activity-list-unnegated> ==> { 0, RP[1] }
|
||||
not <activity-list-unnegated> | ==> { 0, RP[1] }; @<Flip the activity list parities@>;
|
||||
<activity-list-unnegated> ==> { 0, RP[1] }
|
||||
|
||||
<activity-list-unnegated> ::=
|
||||
... | ==> 0; return preform_lookahead_mode; /* match only when looking ahead */
|
||||
<activity-list-entry> <activity-tail> | ==> @<Join the activity lists@>;
|
||||
<activity-list-entry> ==> { 0, RP[1] }
|
||||
... | ==> { lookahead }
|
||||
<activity-list-entry> <activity-tail> | ==> @<Join the activity lists@>;
|
||||
<activity-list-entry> ==> { 0, RP[1] }
|
||||
|
||||
<activity-tail> ::=
|
||||
, _or <run-time-context> | ==> { 0, RP[1] }
|
||||
_,/or <run-time-context> ==> { 0, RP[1] }
|
||||
, _or <run-time-context> | ==> { 0, RP[1] }
|
||||
_,/or <run-time-context> ==> { 0, RP[1] }
|
||||
|
||||
<activity-list-entry> ::=
|
||||
<activity-name> | ==> @<Make one-entry AL without operand@>
|
||||
<activity-name> of/for <activity-operand> | ==> @<Make one-entry AL with operand@>
|
||||
<activity-name> <activity-operand> | ==> @<Make one-entry AL with operand@>
|
||||
^<if-parsing-al-conditions> ... | ==> @<Make one-entry AL with unparsed text@>
|
||||
<if-parsing-al-conditions> <s-condition> ==> @<Make one-entry AL with condition@>
|
||||
<activity-name> | ==> @<Make one-entry AL without operand@>
|
||||
<activity-name> of/for <activity-operand> | ==> @<Make one-entry AL with operand@>
|
||||
<activity-name> <activity-operand> | ==> @<Make one-entry AL with operand@>
|
||||
^<if-parsing-al-conditions> ... | ==> @<Make one-entry AL with unparsed text@>
|
||||
<if-parsing-al-conditions> <s-condition> ==> @<Make one-entry AL with condition@>
|
||||
|
||||
@ The optional operand handles "something" itself in productions (a) and (b)
|
||||
in order to prevent it from being read as a description at production (c). This
|
||||
|
@ -480,9 +480,9 @@ values, of the kind to which the activity applies.
|
|||
|
||||
=
|
||||
<activity-operand> ::=
|
||||
something/anything | ==> FALSE; *XP = Specifications::new_UNKNOWN(W);
|
||||
something/anything else | ==> FALSE; *XP = Specifications::new_UNKNOWN(W);
|
||||
<s-type-expression-or-value> ==> { TRUE, RP[1] }
|
||||
something/anything | ==> { FALSE, Specifications::new_UNKNOWN(W) }
|
||||
something/anything else | ==> { FALSE, Specifications::new_UNKNOWN(W) }
|
||||
<s-type-expression-or-value> ==> { TRUE, RP[1] }
|
||||
|
||||
@<Flip the activity list parities@> =
|
||||
activity_list *al = *XP;
|
||||
|
|
|
@ -134,23 +134,23 @@ The following parses a declaration of named outcomes. For example:
|
|||
|
||||
=
|
||||
<rulebook-outcome-list> ::=
|
||||
... | ==> 0; return preform_lookahead_mode; /* match only when looking ahead */
|
||||
<rulebook-outcome-setting-entry> <rulebook-outcome-tail> | ==> { 0, - }
|
||||
<rulebook-outcome-setting-entry> ==> { 0, - }
|
||||
... | ==> { lookahead }
|
||||
<rulebook-outcome-setting-entry> <rulebook-outcome-tail> | ==> { 0, - }
|
||||
<rulebook-outcome-setting-entry> ==> { 0, - }
|
||||
|
||||
<rulebook-outcome-tail> ::=
|
||||
, _and/or <rulebook-outcome-list> | ==> { 0, - }
|
||||
_,/and/or <rulebook-outcome-list> ==> { 0, - }
|
||||
, _and/or <rulebook-outcome-list> | ==> { 0, - }
|
||||
_,/and/or <rulebook-outcome-list> ==> { 0, - }
|
||||
|
||||
<rulebook-outcome-setting-entry> ::=
|
||||
<form-of-named-rule-outcome> ==> 0; if (!preform_lookahead_mode) @<Adopt this new named rule outcome@>
|
||||
<form-of-named-rule-outcome> ==> {0, - }; if (!preform_lookahead_mode) @<Adopt this new named rule outcome@>
|
||||
|
||||
<form-of-named-rule-outcome> ::=
|
||||
... ( <rule-outcome> - the default ) | ==> R[1]; default_rbno_flag = TRUE
|
||||
... ( <rule-outcome> - default ) | ==> R[1]; default_rbno_flag = TRUE
|
||||
... ( <rule-outcome> ) | ==> R[1]; default_rbno_flag = FALSE
|
||||
... ( ... ) | ==> @<Issue PM_BadOutcomeClarification problem@>
|
||||
... ==> SUCCESS_OUTCOME; default_rbno_flag = FALSE
|
||||
... ( <rule-outcome> - the default ) | ==> { R[1], -}; default_rbno_flag = TRUE
|
||||
... ( <rule-outcome> - default ) | ==> { R[1], -}; default_rbno_flag = TRUE
|
||||
... ( <rule-outcome> ) | ==> { R[1], -}; default_rbno_flag = FALSE
|
||||
... ( ... ) | ==> @<Issue PM_BadOutcomeClarification problem@>
|
||||
... ==> { SUCCESS_OUTCOME, -}; default_rbno_flag = FALSE
|
||||
|
||||
<notable-rulebook-outcomes> ::=
|
||||
it is very likely |
|
||||
|
|
|
@ -82,24 +82,24 @@ following won't pick up many false positives.
|
|||
|
||||
=
|
||||
<nounphrase-rule-list> ::=
|
||||
... | ==> 0; *XP = NULL; return preform_lookahead_mode; /* match only when looking ahead */
|
||||
<nounphrase-rule> <np-rule-tail> | ==> 0; *XP = Diagrams::new_AND(R[2], RP[1], RP[2])
|
||||
<nounphrase-rule> ==> { 0, RP[1] }
|
||||
... | ==> { lookahead }
|
||||
<nounphrase-rule> <np-rule-tail> | ==> { 0, Diagrams::new_AND(R[2], RP[1], RP[2]) }
|
||||
<nounphrase-rule> ==> { 0, RP[1] }
|
||||
|
||||
<np-rule-tail> ::=
|
||||
, {_and} <nounphrase-rule-list> | ==> Wordings::first_wn(W); *XP= RP[1]
|
||||
{_,/and} <nounphrase-rule-list> ==> Wordings::first_wn(W); *XP= RP[1]
|
||||
, {_and} <nounphrase-rule-list> | ==> { Wordings::first_wn(W), RP[1] }
|
||||
{_,/and} <nounphrase-rule-list> ==> { Wordings::first_wn(W), RP[1] }
|
||||
|
||||
<nounphrase-rule> ::=
|
||||
... rule ==> 0; *XP = Diagrams::new_UNPARSED_NOUN(W)
|
||||
... rule ==> { 0, Diagrams::new_UNPARSED_NOUN(W) }
|
||||
|
||||
@ This handles the special meaning "X substitutes for Y".
|
||||
|
||||
=
|
||||
<substitutes-for-sentence-object> ::=
|
||||
<nounphrase-rule> | ==> { NOT_APPLICABLE, RP[1] }
|
||||
<nounphrase-rule> if/when <np-unparsed> | ==> { TRUE, RP[1] }; ((parse_node *) RP[1])->next = RP[2];
|
||||
<nounphrase-rule> unless <np-unparsed> ==> { FALSE, RP[1] }; ((parse_node *) RP[1])->next = RP[2];
|
||||
<nounphrase-rule> | ==> { NOT_APPLICABLE, RP[1] }
|
||||
<nounphrase-rule> if/when <np-unparsed> | ==> { TRUE, RP[1] }; ((parse_node *) RP[1])->next = RP[2];
|
||||
<nounphrase-rule> unless <np-unparsed> ==> { FALSE, RP[1] }; ((parse_node *) RP[1])->next = RP[2];
|
||||
|
||||
@ =
|
||||
int Rules::Placement::substitutes_for_SMF(int task, parse_node *V, wording *NPs) {
|
||||
|
@ -285,33 +285,33 @@ The subject noun phrase is an articled list, each entry of which must match:
|
|||
=
|
||||
<listed-in-sentence-subject> ::=
|
||||
<rule-name> | ==> { TRUE, RP[1] }
|
||||
... ==> FALSE; @<Issue PM_NoSuchRuleExists problem@>
|
||||
... ==> { FALSE, - }; @<Issue PM_NoSuchRuleExists problem@>
|
||||
|
||||
@ The object NP is more flexible:
|
||||
|
||||
=
|
||||
<listed-in-sentence-object-inner> ::=
|
||||
in any rulebook | ==> { ANY_RULE_PLACEMENT, - }
|
||||
in <destination-rulebook> | ==> MIDDLE_PLACEMENT + 1000*IN_SIDE; *XP = RP[1];
|
||||
first in <destination-rulebook> | ==> FIRST_PLACEMENT + 1000*IN_SIDE; *XP = RP[1];
|
||||
last in <destination-rulebook> | ==> LAST_PLACEMENT + 1000*IN_SIDE; *XP = RP[1];
|
||||
instead of <rule-name> in <rulebook-name> | ==> MIDDLE_PLACEMENT + 1000*INSTEAD_SIDE; relative_to_which = RP[1]; *XP = RP[2];
|
||||
instead of <rule-name> in ... | ==> @<Issue PM_NoSuchRulebookPlacement problem@>
|
||||
instead of ... in ... | ==> @<Issue PM_NoSuchRuleExists problem@>
|
||||
before <rule-name> in <rulebook-name> | ==> MIDDLE_PLACEMENT + 1000*BEFORE_SIDE; relative_to_which = RP[1]; *XP = RP[2];
|
||||
before <rule-name> in ... | ==> @<Issue PM_NoSuchRulebookPlacement problem@>
|
||||
before ... in ... | ==> @<Issue PM_NoSuchRuleExists problem@>
|
||||
after <rule-name> in <rulebook-name> | ==> MIDDLE_PLACEMENT + 1000*AFTER_SIDE; relative_to_which = RP[1]; *XP = RP[2];
|
||||
after <rule-name> in ... | ==> @<Issue PM_NoSuchRulebookPlacement problem@>
|
||||
after ... in ... | ==> @<Issue PM_NoSuchRuleExists problem@>
|
||||
instead of ... | ==> @<Issue PM_UnspecifiedRulebookPlacement problem@>
|
||||
before ... | ==> @<Issue PM_UnspecifiedRulebookPlacement problem@>
|
||||
after ... | ==> @<Issue PM_UnspecifiedRulebookPlacement problem@>
|
||||
... ==> @<Issue PM_ImproperRulePlacement problem@>
|
||||
in any rulebook | ==> { ANY_RULE_PLACEMENT, - }
|
||||
in <destination-rulebook> | ==> { MIDDLE_PLACEMENT + 1000*IN_SIDE, RP[1] }
|
||||
first in <destination-rulebook> | ==> { FIRST_PLACEMENT + 1000*IN_SIDE, RP[1] }
|
||||
last in <destination-rulebook> | ==> { LAST_PLACEMENT + 1000*IN_SIDE, RP[1] }
|
||||
instead of <rule-name> in <rulebook-name> | ==> { MIDDLE_PLACEMENT + 1000*INSTEAD_SIDE, RP[2] }; relative_to_which = RP[1];
|
||||
instead of <rule-name> in ... | ==> @<Issue PM_NoSuchRulebookPlacement problem@>
|
||||
instead of ... in ... | ==> @<Issue PM_NoSuchRuleExists problem@>
|
||||
before <rule-name> in <rulebook-name> | ==> { MIDDLE_PLACEMENT + 1000*BEFORE_SIDE, RP[2] }; relative_to_which = RP[1];
|
||||
before <rule-name> in ... | ==> @<Issue PM_NoSuchRulebookPlacement problem@>
|
||||
before ... in ... | ==> @<Issue PM_NoSuchRuleExists problem@>
|
||||
after <rule-name> in <rulebook-name> | ==> { MIDDLE_PLACEMENT + 1000*AFTER_SIDE, RP[2] }; relative_to_which = RP[1];
|
||||
after <rule-name> in ... | ==> @<Issue PM_NoSuchRulebookPlacement problem@>
|
||||
after ... in ... | ==> @<Issue PM_NoSuchRuleExists problem@>
|
||||
instead of ... | ==> @<Issue PM_UnspecifiedRulebookPlacement problem@>
|
||||
before ... | ==> @<Issue PM_UnspecifiedRulebookPlacement problem@>
|
||||
after ... | ==> @<Issue PM_UnspecifiedRulebookPlacement problem@>
|
||||
... ==> @<Issue PM_ImproperRulePlacement problem@>
|
||||
|
||||
<destination-rulebook> ::=
|
||||
<rulebook-name> | ==> { 0, RP[1] }
|
||||
... ==> @<Issue PM_NoSuchRulebookPlacement problem@>
|
||||
<rulebook-name> | ==> { 0, RP[1] }
|
||||
... ==> @<Issue PM_NoSuchRulebookPlacement problem@>
|
||||
|
||||
@
|
||||
|
||||
|
|
|
@ -448,21 +448,21 @@ word "to".
|
|||
|
||||
=
|
||||
<phrase-preamble> ::=
|
||||
<phrase-preamble> ( deprecated ) | ==> R[1]; <<deprecated>> = TRUE
|
||||
<say-preamble> | ==> SAY_ANN; <<say-ann>> = R[1]
|
||||
<to-preamble> ==> { pass 1 }
|
||||
<phrase-preamble> ( deprecated ) | ==> { R[1], -, <<deprecated>> = TRUE }
|
||||
<say-preamble> | ==> { SAY_ANN, -, <<say-ann>> = R[1] }
|
||||
<to-preamble> ==> { pass 1 }
|
||||
|
||||
<to-preamble> ::=
|
||||
<to-preamble> ( arithmetic operation <cardinal-number> ) | ==> R[1]; <<operation>> = R[2]
|
||||
<to-preamble> ( assignment operation ) | ==> R[1]; <<assignment>> = TRUE
|
||||
{let ... be given by ...} | ==> LET_ANN; <<eqn>> = TRUE
|
||||
{let ...} | ==> LET_ANN; <<eqn>> = FALSE
|
||||
... -- end | ==> { BLOCK_ANN, - }
|
||||
... -- end conditional | ==> { CONDITIONAL_ANN, - }
|
||||
... -- end loop | ==> { LOOP_ANN, - }
|
||||
... -- in loop | ==> { IN_LOOP_ANN, - }
|
||||
... -- in ### | ==> { IN_ANN, - }
|
||||
... ==> NO_ANN
|
||||
<to-preamble> ( arithmetic operation <cardinal-number> ) | ==> { R[1], -, <<operation>> = R[2] }
|
||||
<to-preamble> ( assignment operation ) | ==> { R[1], -, <<assignment>> = TRUE }
|
||||
{let ... be given by ...} | ==> { LET_ANN, -, <<eqn>> = TRUE }
|
||||
{let ...} | ==> { LET_ANN, -, <<eqn>> = FALSE }
|
||||
... -- end | ==> { BLOCK_ANN, - }
|
||||
... -- end conditional | ==> { CONDITIONAL_ANN, - }
|
||||
... -- end loop | ==> { LOOP_ANN, - }
|
||||
... -- in loop | ==> { IN_LOOP_ANN, - }
|
||||
... -- in ### | ==> { IN_ANN, - }
|
||||
... ==> { NO_ANN, - }
|
||||
|
||||
@ The definition remaining after the preamble is removed is then vetted.
|
||||
This is a possibly controversial point, in fact, because the check in question
|
||||
|
@ -472,7 +472,7 @@ messages.
|
|||
|
||||
=
|
||||
<phrase-vetting> ::=
|
||||
( ...... ) <copular-verb> {<copular-preposition>} ( ...... ) ==> <<rel1>> = Wordings::first_wn(WR[2]); <<rel2>> = Wordings::last_wn(WR[2]); <<preposition:prep>> = RP[2]; @<Issue PM_MasksRelation problem@>
|
||||
( ...... ) <copular-verb> {<copular-preposition>} ( ...... ) ==> { -, -, <<rel1>> = Wordings::first_wn(WR[2]), <<rel2>> = Wordings::last_wn(WR[2]), <<preposition:prep>> = RP[2] }; @<Issue PM_MasksRelation problem@>
|
||||
|
||||
@<Issue PM_MasksRelation problem@> =
|
||||
preposition *prep = <<preposition:prep>>;
|
||||
|
@ -498,16 +498,16 @@ the exception being the primordial phrase for saying text.
|
|||
|
||||
=
|
||||
<say-preamble> ::=
|
||||
<say-preamble> -- running on | ==> R[1]; <<run-on>> = TRUE
|
||||
{say otherwise/else} | ==> CONTROL_SANN; <<control>> = OTHERWISE_SAY_CS
|
||||
{say otherwise/else if/unless ...} | ==> CONTROL_SANN; <<control>> = OTHERWISE_IF_SAY_CS
|
||||
{say if/unless ...} | ==> CONTROL_SANN; <<control>> = IF_SAY_CS
|
||||
{say end if/unless} | ==> CONTROL_SANN; <<control>> = END_IF_SAY_CS
|
||||
{say ...} -- beginning ### | ==> { BEGIN_SANN, - }
|
||||
{say ...} -- continuing ### | ==> { CONTINUE_SANN, - }
|
||||
{say ...} -- ending ### with marker ### | ==> { ENDM_SANN, - }
|
||||
{say ...} -- ending ### | ==> { END_SANN, - }
|
||||
{say ...} ==> { NO_SANN, - }
|
||||
<say-preamble> -- running on | ==> { R[1], -, <<run-on>> = TRUE }
|
||||
{say otherwise/else} | ==> { CONTROL_SANN, -, <<control>> = OTHERWISE_SAY_CS }
|
||||
{say otherwise/else if/unless ...} | ==> { CONTROL_SANN, -, <<control>> = OTHERWISE_IF_SAY_CS }
|
||||
{say if/unless ...} | ==> { CONTROL_SANN, -, <<control>> = IF_SAY_CS }
|
||||
{say end if/unless} | ==> { CONTROL_SANN, -, <<control>> = END_IF_SAY_CS }
|
||||
{say ...} -- beginning ### | ==> { BEGIN_SANN, - }
|
||||
{say ...} -- continuing ### | ==> { CONTINUE_SANN, - }
|
||||
{say ...} -- ending ### with marker ### | ==> { ENDM_SANN, - }
|
||||
{say ...} -- ending ### | ==> { END_SANN, - }
|
||||
{say ...} ==> { NO_SANN, - }
|
||||
|
||||
@ The following is used on the same text as <to-preamble>, but later on,
|
||||
for timing reasons.
|
||||
|
@ -647,11 +647,11 @@ give problems for misuse of brackets.
|
|||
|
||||
=
|
||||
<phrase-definition-word-or-token> ::=
|
||||
( ) *** | ==> @<Issue PM_TokenWithEmptyBrackets problem@>
|
||||
( <phrase-token-declaration> ) *** | ==> TRUE; <<token-form>> = R[1]; *XP = RP[1]
|
||||
( *** | ==> @<Issue PM_TokenWithoutCloseBracket problem@>
|
||||
) *** | ==> @<Issue PM_TokenWithoutOpenBracket problem@>
|
||||
### *** ==> { FALSE, - }
|
||||
( ) *** | ==> @<Issue PM_TokenWithEmptyBrackets problem@>
|
||||
( <phrase-token-declaration> ) *** | ==> { TRUE, RP[1], <<token-form>> = R[1] }
|
||||
( *** | ==> @<Issue PM_TokenWithoutCloseBracket problem@>
|
||||
) *** | ==> @<Issue PM_TokenWithoutOpenBracket problem@>
|
||||
### *** ==> { FALSE, - }
|
||||
|
||||
@ Phrase token declarations allow a variety of non-standard constructs.
|
||||
|
||||
|
@ -660,31 +660,31 @@ the hyphen, and this is sorely needed with complicated functional kinds.
|
|||
|
||||
=
|
||||
<phrase-token-declaration> ::=
|
||||
*** ( *** - ...... | ==> @<Issue PM_TokenWithNestedBrackets problem@>
|
||||
...... - a nonexisting variable | ==> TRUE; *XP = Specifications::from_kind(K_value); <<token-construct>> = NEW_LOCAL_PT_CONSTRUCT
|
||||
...... - a nonexisting <k-kind-for-template> variable | ==> TRUE; *XP = Specifications::from_kind(RP[1]); <<token-construct>> = NEW_LOCAL_PT_CONSTRUCT
|
||||
...... - a nonexisting <k-kind-for-template> that/which varies | ==> TRUE; *XP = Specifications::from_kind(RP[1]); <<token-construct>> = NEW_LOCAL_PT_CONSTRUCT
|
||||
...... - nonexisting variable | ==> TRUE; *XP = Specifications::from_kind(K_value); <<token-construct>> = NEW_LOCAL_PT_CONSTRUCT
|
||||
...... - nonexisting <k-kind-for-template> variable | ==> TRUE; *XP = Specifications::from_kind(RP[1]); <<token-construct>> = NEW_LOCAL_PT_CONSTRUCT
|
||||
...... - nonexisting <k-kind-for-template> that/which varies | ==> TRUE; *XP = Specifications::from_kind(RP[1]); <<token-construct>> = NEW_LOCAL_PT_CONSTRUCT
|
||||
...... - {an existing variable} | ==> TRUE; *XP = Specifications::from_kind(K_value); Node::set_text(*XP, WR[2]); <<token-construct>> = EXISTING_LOCAL_PT_CONSTRUCT
|
||||
...... - {an existing <k-kind-for-template> variable} | ==> TRUE; *XP = Specifications::from_kind(RP[1]); Node::set_text(*XP, WR[2]); <<token-construct>> = EXISTING_LOCAL_PT_CONSTRUCT
|
||||
...... - {an existing <k-kind-for-template> that/which varies} | ==> TRUE; *XP = Specifications::from_kind(RP[1]); Node::set_text(*XP, WR[2]); <<token-construct>> = EXISTING_LOCAL_PT_CONSTRUCT
|
||||
...... - {existing variable} | ==> TRUE; *XP = Specifications::from_kind(K_value); Node::set_text(*XP, WR[2]); <<token-construct>> = EXISTING_LOCAL_PT_CONSTRUCT
|
||||
...... - {existing <k-kind-for-template> variable} | ==> TRUE; *XP = Specifications::from_kind(RP[1]); Node::set_text(*XP, WR[2]); <<token-construct>> = EXISTING_LOCAL_PT_CONSTRUCT
|
||||
...... - {existing <k-kind-for-template> that/which varies} | ==> TRUE; *XP = Specifications::from_kind(RP[1]); Node::set_text(*XP, WR[2]); <<token-construct>> = EXISTING_LOCAL_PT_CONSTRUCT
|
||||
...... - a condition | ==> TRUE; *XP = NULL; <<token-construct>> = CONDITION_PT_CONSTRUCT
|
||||
...... - condition | ==> TRUE; *XP = NULL; <<token-construct>> = CONDITION_PT_CONSTRUCT
|
||||
...... - a phrase | ==> TRUE; *XP = NULL; <<token-construct>> = VOID_PT_CONSTRUCT
|
||||
...... - phrase | ==> TRUE; *XP = NULL; <<token-construct>> = VOID_PT_CONSTRUCT
|
||||
...... - storage | ==> TRUE; *XP = Specifications::from_kind(K_value); Node::set_text(*XP, WR[2]); <<token-construct>> = STORAGE_PT_CONSTRUCT
|
||||
...... - a table-reference | ==> TRUE; *XP = Specifications::from_kind(K_value); Node::set_text(*XP, WR[2]); <<token-construct>> = TABLE_REFERENCE_PT_CONSTRUCT
|
||||
...... - table-reference | ==> TRUE; *XP = Specifications::from_kind(K_value); Node::set_text(*XP, WR[2]); <<token-construct>> = TABLE_REFERENCE_PT_CONSTRUCT
|
||||
...... - <s-phrase-token-type> | ==> { TRUE, RP[1], <<token-construct>> = STANDARD_PT_CONSTRUCT }
|
||||
...... - <s-kind-as-name-token> | ==> { TRUE, RP[1], <<token-construct>> = KIND_NAME_PT_CONSTRUCT }
|
||||
...... - ...... | ==> @<Issue PM_BadTypeIndication problem@>
|
||||
<s-kind-as-name-token> | ==> { FALSE, RP[1], <<token-construct>> = KIND_NAME_PT_CONSTRUCT }
|
||||
...... ==> @<Issue PM_TokenMisunderstood problem@>
|
||||
*** ( *** - ...... | ==> @<Issue PM_TokenWithNestedBrackets problem@>
|
||||
...... - a nonexisting variable | ==> { TRUE, Specifications::from_kind(K_value), <<token-construct>> = NEW_LOCAL_PT_CONSTRUCT }
|
||||
...... - a nonexisting <k-kind-for-template> variable | ==> { TRUE, Specifications::from_kind(RP[1]), <<token-construct>> = NEW_LOCAL_PT_CONSTRUCT }
|
||||
...... - a nonexisting <k-kind-for-template> that/which varies | ==> { TRUE, Specifications::from_kind(RP[1]), <<token-construct>> = NEW_LOCAL_PT_CONSTRUCT }
|
||||
...... - nonexisting variable | ==> { TRUE, Specifications::from_kind(K_value), <<token-construct>> = NEW_LOCAL_PT_CONSTRUCT }
|
||||
...... - nonexisting <k-kind-for-template> variable | ==> { TRUE, Specifications::from_kind(RP[1]), <<token-construct>> = NEW_LOCAL_PT_CONSTRUCT }
|
||||
...... - nonexisting <k-kind-for-template> that/which varies | ==> { TRUE, Specifications::from_kind(RP[1]), <<token-construct>> = NEW_LOCAL_PT_CONSTRUCT }
|
||||
...... - {an existing variable} | ==> { TRUE, Specifications::from_kind(K_value), <<token-construct>> = EXISTING_LOCAL_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]);
|
||||
...... - {an existing <k-kind-for-template> variable} | ==> { TRUE, Specifications::from_kind(RP[1]), <<token-construct>> = EXISTING_LOCAL_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]);
|
||||
...... - {an existing <k-kind-for-template> that/which varies} | ==> { TRUE, Specifications::from_kind(RP[1]), <<token-construct>> = EXISTING_LOCAL_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]);
|
||||
...... - {existing variable} | ==> { TRUE, Specifications::from_kind(K_value), <<token-construct>> = EXISTING_LOCAL_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]);
|
||||
...... - {existing <k-kind-for-template> variable} | ==> { TRUE, Specifications::from_kind(RP[1]), <<token-construct>> = EXISTING_LOCAL_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]);
|
||||
...... - {existing <k-kind-for-template> that/which varies} | ==> { TRUE, Specifications::from_kind(RP[1]), <<token-construct>> = EXISTING_LOCAL_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]);
|
||||
...... - a condition | ==> { TRUE, NULL, <<token-construct>> = CONDITION_PT_CONSTRUCT }
|
||||
...... - condition | ==> { TRUE, NULL, <<token-construct>> = CONDITION_PT_CONSTRUCT }
|
||||
...... - a phrase | ==> { TRUE, NULL, <<token-construct>> = VOID_PT_CONSTRUCT }
|
||||
...... - phrase | ==> { TRUE, NULL, <<token-construct>> = VOID_PT_CONSTRUCT }
|
||||
...... - storage | ==> { TRUE, Specifications::from_kind(K_value), <<token-construct>> = STORAGE_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]);
|
||||
...... - a table-reference | ==> { TRUE, Specifications::from_kind(K_value), <<token-construct>> = TABLE_REFERENCE_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]);
|
||||
...... - table-reference | ==> { TRUE, Specifications::from_kind(K_value), <<token-construct>> = TABLE_REFERENCE_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]);
|
||||
...... - <s-phrase-token-type> | ==> { TRUE, RP[1], <<token-construct>> = STANDARD_PT_CONSTRUCT }
|
||||
...... - <s-kind-as-name-token> | ==> { TRUE, RP[1], <<token-construct>> = KIND_NAME_PT_CONSTRUCT }
|
||||
...... - ...... | ==> @<Issue PM_BadTypeIndication problem@>
|
||||
<s-kind-as-name-token> | ==> { FALSE, RP[1], <<token-construct>> = KIND_NAME_PT_CONSTRUCT }
|
||||
...... ==> @<Issue PM_TokenMisunderstood problem@>
|
||||
|
||||
@<Issue PM_TokenWithEmptyBrackets problem@> =
|
||||
*X = NOT_APPLICABLE;
|
||||
|
|
|
@ -128,7 +128,7 @@ and creates two options with <phrase-option-declaration-setting-entry>.
|
|||
|
||||
=
|
||||
<phrase-option-declaration-list> ::=
|
||||
... | ==> FALSE; return preform_lookahead_mode; /* match only when looking ahead */
|
||||
... | ==> { lookahead }
|
||||
<phrase-option-declaration-setting-entry> <phrase-option-declaration-tail> | ==> { pass 2 }
|
||||
<phrase-option-declaration-setting-entry> ==> { FALSE, - }
|
||||
|
||||
|
@ -139,7 +139,12 @@ and creates two options with <phrase-option-declaration-setting-entry>.
|
|||
\and/or <phrase-option-declaration-list> ==> { TRUE, - }
|
||||
|
||||
<phrase-option-declaration-setting-entry> ::=
|
||||
... ==> FALSE; if (!preform_lookahead_mode) Phrases::Options::phod_add_phrase_option(phod_being_parsed, W);
|
||||
... | ==> { lookahead }
|
||||
... ==> @<Add a phrase option@>;
|
||||
|
||||
@<Add a phrase option@> =
|
||||
Phrases::Options::phod_add_phrase_option(phod_being_parsed, W);
|
||||
==> { FALSE, - };
|
||||
|
||||
@ =
|
||||
int too_many_POs_error = FALSE;
|
||||
|
|
|
@ -132,23 +132,23 @@ just enough from the wording to tell what sort of rule/phrase is to follow.
|
|||
|
||||
=
|
||||
<rule-preamble> ::=
|
||||
definition | ==> { DEFINITIONAL_PHRASE_EFF, - }
|
||||
this is the {... rule} | ==> RULE_NOT_IN_RULEBOOK_EFF; <<event-time>> = NOT_AN_EVENT; <<written>> = FALSE;
|
||||
this is the rule | ==> @<Issue PM_NamelessRule problem@>
|
||||
this is ... rule | ==> @<Issue PM_UnarticledRule problem@>
|
||||
this is ... rules | ==> @<Issue PM_PluralisedRule problem@>
|
||||
<event-rule-preamble> | ==> RULE_NOT_IN_RULEBOOK_EFF; <<event-time>> = R[1]
|
||||
to | ==> @<Issue PM_BareTo problem@>
|
||||
to ... ( called ... ) | ==> @<Issue PM_DontCallPhrasesWithCalled problem@>
|
||||
{to ...} ( this is the {### function} inverse to ### ) | ==> TO_PHRASE_EFF; <<named>> = TRUE; <<written>> = TRUE; <<inverted>> = TRUE;
|
||||
{to ...} ( this is the {### function} ) | ==> TO_PHRASE_EFF; <<named>> = TRUE; <<written>> = TRUE; <<inverted>> = FALSE;
|
||||
{to ...} ( this is ... ) | ==> TO_PHRASE_EFF; <<named>> = TRUE; <<written>> = FALSE;
|
||||
to ... | ==> TO_PHRASE_EFF; <<named>> = FALSE
|
||||
... ( this is the {... rule} ) | ==> RULE_IN_RULEBOOK_EFF; <<named>> = TRUE; <<written>> = FALSE;
|
||||
... ( this is the rule ) | ==> @<Issue PM_NamelessRule problem@>
|
||||
... ( this is ... rule ) | ==> @<Issue PM_UnarticledRule problem@>
|
||||
... ( this is ... rules ) | ==> @<Issue PM_PluralisedRule problem@>
|
||||
... ==> RULE_IN_RULEBOOK_EFF; <<named>> = FALSE
|
||||
definition | ==> { DEFINITIONAL_PHRASE_EFF, - }
|
||||
this is the {... rule} | ==> { RULE_NOT_IN_RULEBOOK_EFF, -, <<event-time>> = NOT_AN_EVENT, <<written>> = FALSE }
|
||||
this is the rule | ==> @<Issue PM_NamelessRule problem@>
|
||||
this is ... rule | ==> @<Issue PM_UnarticledRule problem@>
|
||||
this is ... rules | ==> @<Issue PM_PluralisedRule problem@>
|
||||
<event-rule-preamble> | ==> { RULE_NOT_IN_RULEBOOK_EFF, -, <<event-time>> = R[1] }
|
||||
to | ==> @<Issue PM_BareTo problem@>
|
||||
to ... ( called ... ) | ==> @<Issue PM_DontCallPhrasesWithCalled problem@>
|
||||
{to ...} ( this is the {### function} inverse to ### ) | ==> { TO_PHRASE_EFF, -, <<named>> = TRUE, <<written>> = TRUE, <<inverted>> = TRUE }
|
||||
{to ...} ( this is the {### function} ) | ==> { TO_PHRASE_EFF, -, <<named>> = TRUE, <<written>> = TRUE, <<inverted>> = FALSE }
|
||||
{to ...} ( this is ... ) | ==> { TO_PHRASE_EFF, -, <<named>> = TRUE, <<written>> = FALSE }
|
||||
to ... | ==> { TO_PHRASE_EFF, -, <<named>> = FALSE }
|
||||
... ( this is the {... rule} ) | ==> { RULE_IN_RULEBOOK_EFF, -, <<named>> = TRUE, <<written>> = FALSE }
|
||||
... ( this is the rule ) | ==> @<Issue PM_NamelessRule problem@>
|
||||
... ( this is ... rule ) | ==> @<Issue PM_UnarticledRule problem@>
|
||||
... ( this is ... rules ) | ==> @<Issue PM_PluralisedRule problem@>
|
||||
... ==> { RULE_IN_RULEBOOK_EFF, -, <<named>> = FALSE }
|
||||
|
||||
@<Issue PM_NamelessRule problem@> =
|
||||
StandardProblems::sentence_problem(Task::syntax_tree(), _p_(PM_NamelessRule),
|
||||
|
@ -203,25 +203,25 @@ following grammar. (Parsing this is "fine mode".)
|
|||
|
||||
=
|
||||
<rule-preamble-fine> ::=
|
||||
<rule-preamble-finer> during <s-scene-description> | ==> R[1]; <<parse_node:scenes>> = RP[2]
|
||||
<rule-preamble-finer> ==> R[1]; <<parse_node:scenes>> = NULL
|
||||
<rule-preamble-finer> during <s-scene-description> | ==> { R[1], -, <<parse_node:scenes>> = RP[2] }
|
||||
<rule-preamble-finer> ==> { R[1], -, <<parse_node:scenes>> = NULL }
|
||||
|
||||
<rule-preamble-finer> ::=
|
||||
{<rulebook-stem-embellished>} {when/while ...} | ==> { TRUE, - }
|
||||
{<rulebook-stem-embellished>} | ==> { FALSE, - }
|
||||
... ==> { NOT_APPLICABLE, - }
|
||||
{<rulebook-stem-embellished>} {when/while ...} | ==> { TRUE, - }
|
||||
{<rulebook-stem-embellished>} | ==> { FALSE, - }
|
||||
... ==> { NOT_APPLICABLE, - }
|
||||
|
||||
<rulebook-stem-embellished> ::=
|
||||
<rulebook-stem> *** | ==> 0; <<bud1>> = Wordings::first_wn(WR[1]); <<bud2>> = Wordings::last_wn(WR[1])
|
||||
<article> rule for <rulebook-stem> *** | ==> 0; <<bud1>> = Wordings::first_wn(WR[1]); <<bud2>> = Wordings::last_wn(WR[1])
|
||||
<article> rule <rulebook-stem> *** | ==> 0; <<bud1>> = Wordings::first_wn(WR[1]); <<bud2>> = Wordings::last_wn(WR[1])
|
||||
rule for <rulebook-stem> *** | ==> 0; <<bud1>> = Wordings::first_wn(WR[1]); <<bud2>> = Wordings::last_wn(WR[1])
|
||||
rule <rulebook-stem> *** ==> 0; <<bud1>> = Wordings::first_wn(WR[1]); <<bud2>> = Wordings::last_wn(WR[1])
|
||||
<rulebook-stem> *** | ==> { 0, -, <<bud1>> = Wordings::first_wn(WR[1]), <<bud2>> = Wordings::last_wn(WR[1]) }
|
||||
<article> rule for <rulebook-stem> *** | ==> { 0, -, <<bud1>> = Wordings::first_wn(WR[1]), <<bud2>> = Wordings::last_wn(WR[1]) }
|
||||
<article> rule <rulebook-stem> *** | ==> { 0, -, <<bud1>> = Wordings::first_wn(WR[1]), <<bud2>> = Wordings::last_wn(WR[1]) }
|
||||
rule for <rulebook-stem> *** | ==> { 0, -, <<bud1>> = Wordings::first_wn(WR[1]), <<bud2>> = Wordings::last_wn(WR[1]) }
|
||||
rule <rulebook-stem> *** ==> { 0, -, <<bud1>> = Wordings::first_wn(WR[1]), <<bud2>> = Wordings::last_wn(WR[1]) }
|
||||
|
||||
<rulebook-bud> ::=
|
||||
of/for ... | ==> { TRUE, - }
|
||||
rule about/for/on ... | ==> { TRUE, - }
|
||||
rule ==> { FALSE, - }
|
||||
of/for ... | ==> { TRUE, - }
|
||||
rule about/for/on ... | ==> { TRUE, - }
|
||||
rule ==> { FALSE, - }
|
||||
|
||||
@ The following turns the preamble text into a PHUD. It can be used as often
|
||||
as necessary in "coarse mode", but should be run once and once only on any
|
||||
|
@ -970,11 +970,11 @@ might have gone wrong.
|
|||
|
||||
=
|
||||
<action-when-diagnosis> ::=
|
||||
... called ... {when/while ...} | ==> 1; <<cw1>> = Wordings::first_wn(WR[3]); <<cw2>> = Wordings::last_wn(WR[3])
|
||||
... {when/while *** nothing ***} | ==> 2; <<cw1>> = Wordings::first_wn(WR[2]); <<cw2>> = Wordings::last_wn(WR[2])
|
||||
... {when/while *** nowhere ***} | ==> 3; <<cw1>> = Wordings::first_wn(WR[2]); <<cw2>> = Wordings::last_wn(WR[2])
|
||||
... and {when/while ...} | ==> 4; <<cw1>> = Wordings::first_wn(WR[2]); <<cw2>> = Wordings::last_wn(WR[2])
|
||||
... {when/while ...} ==> 5; <<cw1>> = Wordings::first_wn(WR[2]); <<cw2>> = Wordings::last_wn(WR[2])
|
||||
... called ... {when/while ...} | ==> { 1, -, <<cw1>> = Wordings::first_wn(WR[3]), <<cw2>> = Wordings::last_wn(WR[3]) }
|
||||
... {when/while *** nothing ***} | ==> { 2, -, <<cw1>> = Wordings::first_wn(WR[2]), <<cw2>> = Wordings::last_wn(WR[2]) }
|
||||
... {when/while *** nowhere ***} | ==> { 3, -, <<cw1>> = Wordings::first_wn(WR[2]), <<cw2>> = Wordings::last_wn(WR[2]) }
|
||||
... and {when/while ...} | ==> { 4, -, <<cw1>> = Wordings::first_wn(WR[2]), <<cw2>> = Wordings::last_wn(WR[2]) }
|
||||
... {when/while ...} ==> { 5, -, <<cw1>> = Wordings::first_wn(WR[2]), <<cw2>> = Wordings::last_wn(WR[2]) }
|
||||
|
||||
@ =
|
||||
<anl-diagnosis> ::=
|
||||
|
@ -982,7 +982,7 @@ might have gone wrong.
|
|||
<anl-inner-diagnosis> ==> { pass 1 }
|
||||
|
||||
<anl-inner-diagnosis> ::=
|
||||
<anl-entry-diagnosis> <anl-tail-diagnosis> | ==> { R[1]+R[2], - }
|
||||
<anl-entry-diagnosis> <anl-tail-diagnosis> | ==> { R[1] + R[2], - }
|
||||
<anl-entry-diagnosis> ==> { pass 1 }
|
||||
|
||||
<anl-tail-diagnosis> ::=
|
||||
|
|
|
@ -274,11 +274,11 @@ what number is...", for instance.
|
|||
|
||||
=
|
||||
<inline-phrase-definition> ::=
|
||||
(- ### - in to only | ==> DECIDES_NOTHING_MOR; <<inlinecode>> = Wordings::first_wn(WR[1])
|
||||
(- ### - in to decide if only | ==> DECIDES_CONDITION_MOR; <<inlinecode>> = Wordings::first_wn(WR[1])
|
||||
(- ### - in to decide only | ==> DECIDES_VALUE_MOR; <<inlinecode>> = Wordings::first_wn(WR[1])
|
||||
(- ### | ==> DONT_KNOW_MOR; <<inlinecode>> = Wordings::first_wn(WR[1])
|
||||
(- ### ... ==> DONT_KNOW_MOR; <<inlinecode>> = Wordings::first_wn(WR[1]); @<Issue PM_TailAfterInline problem@>
|
||||
(- ### - in to only | ==> { DECIDES_NOTHING_MOR, -, <<inlinecode>> = Wordings::first_wn(WR[1]) }
|
||||
(- ### - in to decide if only | ==> { DECIDES_CONDITION_MOR, -, <<inlinecode>> = Wordings::first_wn(WR[1]) }
|
||||
(- ### - in to decide only | ==> { DECIDES_VALUE_MOR, -, <<inlinecode>> = Wordings::first_wn(WR[1]) }
|
||||
(- ### | ==> { DONT_KNOW_MOR, -, <<inlinecode>> = Wordings::first_wn(WR[1]) }
|
||||
(- ### ... ==> { DONT_KNOW_MOR, -, <<inlinecode>> = Wordings::first_wn(WR[1]) }; @<Issue PM_TailAfterInline problem@>
|
||||
|
||||
@<Issue PM_TailAfterInline problem@> =
|
||||
*X = DONT_KNOW_MOR;
|
||||
|
|
|
@ -81,13 +81,13 @@ the doubled use of colons is unfortunate.)
|
|||
<adjective-domain> is/are <adjective-wording> ==> { DEFINED_PHRASALLY, - }
|
||||
|
||||
<adjective-domain> ::=
|
||||
... ( called the ... ) | ==> 0; <<calling>> = TRUE
|
||||
... ( called ... ) | ==> 0; <<calling>> = TRUE
|
||||
... ==> 0; <<calling>> = FALSE
|
||||
... ( called the ... ) | ==> { 0, -, <<calling>> = TRUE }
|
||||
... ( called ... ) | ==> { 0, -, <<calling>> = TRUE }
|
||||
... ==> { 0, -, <<calling>> = FALSE }
|
||||
|
||||
<adjective-wording> ::=
|
||||
... rather than ... | ==> 0; <<antonym>> = TRUE
|
||||
... ==> 0; <<antonym>> = FALSE
|
||||
... rather than ... | ==> { 0, -, <<antonym>> = TRUE }
|
||||
... ==> { 0, -, <<antonym>> = FALSE }
|
||||
|
||||
@ And here is the supporting code:
|
||||
|
||||
|
|
|
@ -194,10 +194,10 @@ the fixed text "phrase options" expands to the whole bitmap.
|
|||
|
||||
=
|
||||
<inline-substitution> ::=
|
||||
phrase options | ==> { OPTS_INSUB, - }
|
||||
<phrase-option> | ==> OPT_INSUB; <<opt>> = R[1]
|
||||
<name-local-to-inline-stack-frame> | ==> LOCAL_INSUB; <<local_variable:var>> = RP[1]
|
||||
... ==> @<Issue PM_BadInlineExpansion problem@>
|
||||
phrase options | ==> { OPTS_INSUB, - }
|
||||
<phrase-option> | ==> { OPT_INSUB, -, <<opt>> = R[1] }
|
||||
<name-local-to-inline-stack-frame> | ==> { LOCAL_INSUB, -, <<local_variable:var>> = RP[1] }
|
||||
... ==> @<Issue PM_BadInlineExpansion problem@>
|
||||
|
||||
@ This matches one of the token names in the preamble to the inline definition.
|
||||
|
||||
|
@ -215,7 +215,6 @@ the fixed text "phrase options" expands to the whole bitmap.
|
|||
charlatans" and what they "deserve". I'm a better person now.
|
||||
|
||||
@<Issue PM_BadInlineExpansion problem@> =
|
||||
*X = PROBLEM_INSUB;
|
||||
Problems::quote_source(1, current_sentence);
|
||||
Problems::quote_wording(2, W);
|
||||
StandardProblems::handmade_problem(Task::syntax_tree(), _p_(PM_BadInlineExpansion));
|
||||
|
@ -229,6 +228,7 @@ charlatans" and what they "deserve". I'm a better person now.
|
|||
"extensions. A good rule of thumb is: if you can define a phrase without "
|
||||
"using I6 insertions, do.");
|
||||
Problems::issue_problem_end();
|
||||
==> { PROBLEM_INSUB, - };
|
||||
|
||||
@ Acting on that:
|
||||
|
||||
|
|
|
@ -45,12 +45,12 @@ and the following grammar defines the "when defining a thing" end.
|
|||
|
||||
=
|
||||
<inform6-inclusion-location> ::=
|
||||
<inclusion-side> {<quoted-text-without-subs>} | ==> @<Note segment-level inclusion@>
|
||||
<inclusion-side> {<quoted-text-without-subs>} in {<quoted-text-without-subs>} | ==> @<Note section-level inclusion@>
|
||||
when defining <s-type-expression> | ==> WHEN_DEFINING_INC; <<parse_node:s>> = RP[1]
|
||||
when defining ... | ==> @<Issue PM_WhenDefiningUnknown problem@>
|
||||
before the library | ==> @<Issue PM_BeforeTheLibrary problem@>
|
||||
in the preform grammar ==> { AS_PREFORM_INC, - }
|
||||
<inclusion-side> {<quoted-text-without-subs>} | ==> @<Note segment-level inclusion@>
|
||||
<inclusion-side> {<quoted-text-without-subs>} in {<quoted-text-without-subs>} | ==> @<Note section-level inclusion@>
|
||||
when defining <s-type-expression> | ==> { WHEN_DEFINING_INC, -, <<parse_node:s>> = RP[1] }
|
||||
when defining ... | ==> @<Issue PM_WhenDefiningUnknown problem@>
|
||||
before the library | ==> @<Issue PM_BeforeTheLibrary problem@>
|
||||
in the preform grammar ==> { AS_PREFORM_INC, - }
|
||||
|
||||
<inclusion-side> ::=
|
||||
before | ==> { BEFORE_LINK_STAGE, - }
|
||||
|
|
|
@ -88,7 +88,15 @@ present.
|
|||
|
||||
=
|
||||
<language-element> ::=
|
||||
<plugin-name> ==> TRUE; if ((registered_plugins[R[1]] == NULL) || (registered_plugins[R[1]]->now_plugged_in == FALSE)) *X = FALSE;
|
||||
<plugin-name> ==> @<Result true only if plugged in@>;
|
||||
|
||||
@<Result true only if plugged in@> =
|
||||
if ((registered_plugins[R[1]] == NULL) ||
|
||||
(registered_plugins[R[1]]->now_plugged_in == FALSE)) {
|
||||
==> { FALSE, - };
|
||||
} else {
|
||||
==> { TRUE, - };
|
||||
}
|
||||
|
||||
@ =
|
||||
word_assemblage Plugins::Manage::wording(int N) {
|
||||
|
|
|
@ -99,21 +99,21 @@ test_scenario *ts_being_parsed = NULL;
|
|||
|
||||
=
|
||||
<test-sentence-object> ::=
|
||||
<quoted-text> | ==> TRUE; @<Process the quoted test script@>
|
||||
<quoted-text> <test-case-circumstance-list> | ==> TRUE; @<Process the quoted test script@>
|
||||
... ==> @<Issue PM_TestBadRequirements problem@>
|
||||
<quoted-text> | ==> { TRUE, - }; @<Process the quoted test script@>
|
||||
<quoted-text> <test-case-circumstance-list> | ==> { TRUE, - }; @<Process the quoted test script@>
|
||||
... ==> @<Issue PM_TestBadRequirements problem@>
|
||||
|
||||
<test-case-circumstance-list> ::=
|
||||
... | ==> 0; return preform_lookahead_mode;
|
||||
<test-case-circumstance-list> <test-case-circumstance> | ==> { 0, - }
|
||||
<test-case-circumstance> ==> { 0, - }
|
||||
... | ==> { lookahead }
|
||||
<test-case-circumstance-list> <test-case-circumstance> | ==> { 0, - }
|
||||
<test-case-circumstance> ==> { 0, - }
|
||||
|
||||
<test-case-circumstance> ::=
|
||||
in <instance-of-object> | ==> @<Process the in-test requirement@>
|
||||
holding/and/, <instance-of-object> | ==> @<Process the holding requirement@>
|
||||
in ... | ==> @<Issue PM_TestBadRequirements problem@>
|
||||
holding/and/, ... | ==> @<Issue PM_TestBadRequirements problem@>
|
||||
with ... ==> @<Issue PM_TestDoubleWith problem@>
|
||||
in <instance-of-object> | ==> @<Process the in-test requirement@>
|
||||
holding/and/, <instance-of-object> | ==> @<Process the holding requirement@>
|
||||
in ... | ==> @<Issue PM_TestBadRequirements problem@>
|
||||
holding/and/, ... | ==> @<Issue PM_TestBadRequirements problem@>
|
||||
with ... ==> @<Issue PM_TestDoubleWith problem@>
|
||||
|
||||
@<Process the quoted test script@> =
|
||||
int i, x1 = R[1];
|
||||
|
|
|
@ -122,7 +122,7 @@ traversing the parse tree to look for translation sentences of the right sort.
|
|||
|
||||
=
|
||||
<extra-response> ::=
|
||||
<quoted-text> ( <response-letter> ) ==> R[2];
|
||||
<quoted-text> ( <response-letter> ) ==> { pass 2 }
|
||||
|
||||
@ =
|
||||
void IdentifierTranslations::plus_responses(parse_node *p, rule *R) {
|
||||
|
|
|
@ -323,16 +323,16 @@ those which need immediate action.
|
|||
|
||||
=
|
||||
<immediate-use> ::=
|
||||
... | ==> TRUE; return preform_lookahead_mode; /* match only when looking ahead */
|
||||
<immediate-use-entry> <immediate-use-tail> | ==> { TRUE, - }
|
||||
<immediate-use-entry> ==> { TRUE, - }
|
||||
... | ==> { lookahead }
|
||||
<immediate-use-entry> <immediate-use-tail> |
|
||||
<immediate-use-entry>
|
||||
|
||||
<immediate-use-tail> ::=
|
||||
, _and <immediate-use> |
|
||||
_,/and <immediate-use>
|
||||
|
||||
<immediate-use-entry> ::=
|
||||
<notable-use-option-name> | ==> @<Act on this use option immediately@>
|
||||
<notable-use-option-name> | ==> @<Act on this use option immediately@>
|
||||
......
|
||||
|
||||
@<Act on this use option immediately@> =
|
||||
|
|
|
@ -2496,7 +2496,7 @@ of alternatives each of which matches the following:
|
|||
=
|
||||
<specifies-sentence-subject> ::=
|
||||
... ( {<literal-pattern-group-list>} ) | ==> { pass 1 }
|
||||
<k-kind-articled> times <k-kind-articled> | ==> TIMES_LPN; LP_left_kind = RP[1]; LP_right_kind = RP[2];
|
||||
<k-kind-articled> times <k-kind-articled> | ==> { TIMES_LPN, - }; LP_left_kind = RP[1]; LP_right_kind = RP[2];
|
||||
<s-type-expression> times <s-type-expression> | ==> @<Issue PM_MultiplyingNonKOVs problem@>
|
||||
... ==> { 0, NULL }
|
||||
|
||||
|
@ -2567,17 +2567,17 @@ can't set both scaling and an equivalent, for instance.
|
|||
<literal-pattern-specification-tail> ::=
|
||||
with parts <literal-pattern-part-list> | ==> { PARTS_LPC, RP[1] }
|
||||
<scaling-instruction> | ==> { SCALING_LPC, - }
|
||||
<scaling-instruction> offset by <s-literal> | ==> SCALING_LPC; LP_real_offset = latest_constructed_real; LP_offset_value = RP[2];
|
||||
offset by <s-literal> | ==> OFFSET_LPC; LP_real_offset = latest_constructed_real; LP_offset_value = RP[1];
|
||||
equivalent to <s-literal> ==> EQUIVALENT_LPC; LP_real_equivalent = latest_constructed_real; LP_equivalent_value = RP[1];
|
||||
<scaling-instruction> offset by <s-literal> | ==> { SCALING_LPC, - }; LP_real_offset = latest_constructed_real; LP_offset_value = RP[2];
|
||||
offset by <s-literal> | ==> { OFFSET_LPC, - }; LP_real_offset = latest_constructed_real; LP_offset_value = RP[1];
|
||||
equivalent to <s-literal> ==> { EQUIVALENT_LPC, - }; LP_real_equivalent = latest_constructed_real; LP_equivalent_value = RP[1];
|
||||
|
||||
<scaling-instruction> ::=
|
||||
scaled up by <cardinal-number> | ==> SCALING_LPC; LP_scaling = LP_SCALED_UP; LP_scaling_amount = R[1]; LP_real_scaling_amount = (double) LP_scaling_amount;
|
||||
scaled up by <s-literal-real-number> | ==> SCALING_LPC; LP_scaling = LP_SCALED_UP; LP_scaling_amount = 1; LP_real_scaling_amount = latest_constructed_real; LP_to_real = TRUE;
|
||||
scaled down by <cardinal-number> | ==> SCALING_LPC; LP_scaling = LP_SCALED_DOWN; LP_scaling_amount = R[1]; LP_real_scaling_amount = (double) LP_scaling_amount;
|
||||
scaled down by <s-literal-real-number> | ==> SCALING_LPC; LP_scaling = LP_SCALED_DOWN; LP_scaling_amount = 1; LP_real_scaling_amount = latest_constructed_real; LP_to_real = TRUE;
|
||||
scaled at <cardinal-number> | ==> SCALING_LPC; LP_scaling = LP_SCALED_AT; LP_scaling_amount = R[1]; LP_real_scaling_amount = (double) LP_scaling_amount;
|
||||
scaled at <s-literal-real-number> ==> SCALING_LPC; LP_scaling = LP_SCALED_AT; LP_scaling_amount = 1; LP_real_scaling_amount = latest_constructed_real; LP_to_real = TRUE;
|
||||
scaled up by <cardinal-number> | ==> { SCALING_LPC, - }; LP_scaling = LP_SCALED_UP; LP_scaling_amount = R[1]; LP_real_scaling_amount = (double) LP_scaling_amount;
|
||||
scaled up by <s-literal-real-number> | ==> { SCALING_LPC, - }; LP_scaling = LP_SCALED_UP; LP_scaling_amount = 1; LP_real_scaling_amount = latest_constructed_real; LP_to_real = TRUE;
|
||||
scaled down by <cardinal-number> | ==> { SCALING_LPC, - }; LP_scaling = LP_SCALED_DOWN; LP_scaling_amount = R[1]; LP_real_scaling_amount = (double) LP_scaling_amount;
|
||||
scaled down by <s-literal-real-number> | ==> { SCALING_LPC, - }; LP_scaling = LP_SCALED_DOWN; LP_scaling_amount = 1; LP_real_scaling_amount = latest_constructed_real; LP_to_real = TRUE;
|
||||
scaled at <cardinal-number> | ==> { SCALING_LPC, - }; LP_scaling = LP_SCALED_AT; LP_scaling_amount = R[1]; LP_real_scaling_amount = (double) LP_scaling_amount;
|
||||
scaled at <s-literal-real-number> ==> { SCALING_LPC, - }; LP_scaling = LP_SCALED_AT; LP_scaling_amount = 1; LP_real_scaling_amount = latest_constructed_real; LP_to_real = TRUE;
|
||||
|
||||
@<Issue PM_LPNotKOV problem@> =
|
||||
if (preform_lookahead_mode == FALSE) {
|
||||
|
@ -2596,28 +2596,28 @@ by a bracketed list of up to three options in any order.
|
|||
|
||||
=
|
||||
<literal-pattern-part-list> ::=
|
||||
<literal-pattern-part> , and <literal-pattern-part-list> | ==> { 0, RP[1] }; if (RP[1]) ((parse_node *) RP[1])->next = RP[2];
|
||||
<literal-pattern-part> , <literal-pattern-part-list> | ==> { 0, RP[1] }; if (RP[1]) ((parse_node *) RP[1])->next = RP[2];
|
||||
<literal-pattern-part> , and <literal-pattern-part-list> | ==> { 0, RP[1] }; if (RP[1]) ((parse_node *) RP[1])->next = RP[2];
|
||||
<literal-pattern-part> , <literal-pattern-part-list> | ==> { 0, RP[1] }; if (RP[1]) ((parse_node *) RP[1])->next = RP[2];
|
||||
<literal-pattern-part> and <literal-pattern-part-list> | ==> { 0, RP[1] }; if (RP[1]) ((parse_node *) RP[1])->next = RP[2];
|
||||
<literal-pattern-part> ==> { 0, RP[1] }
|
||||
<literal-pattern-part> ==> { 0, RP[1] }
|
||||
|
||||
<literal-pattern-part> ::=
|
||||
<np-unparsed-bal> ( <literal-pattern-part-option-list> ) | ==> { 0, RP[1] }; if (RP[1]) Annotations::write_int(*XP, lpe_options_ANNOT, R[2]);
|
||||
<np-unparsed-bal> ==> { 0, RP[1] }
|
||||
<np-unparsed-bal> ( <literal-pattern-part-option-list> ) | ==> { 0, RP[1] }; if (RP[1]) Annotations::write_int(*XP, lpe_options_ANNOT, R[2]);
|
||||
<np-unparsed-bal> ==> { 0, RP[1] }
|
||||
|
||||
<literal-pattern-part-option-list> ::=
|
||||
<literal-pattern-part-option> <literal-pattern-part-option-tail> | ==> R[1] | R[2]
|
||||
<literal-pattern-part-option> ==> { pass 1 }
|
||||
<literal-pattern-part-option> <literal-pattern-part-option-tail> | ==> { R[1] | R[2], - }
|
||||
<literal-pattern-part-option> ==> { pass 1 }
|
||||
|
||||
<literal-pattern-part-option-tail> ::=
|
||||
, and <literal-pattern-part-option-list> | ==> { pass 1 }
|
||||
,/and <literal-pattern-part-option-list> ==> { pass 1 }
|
||||
, and <literal-pattern-part-option-list> | ==> { pass 1 }
|
||||
,/and <literal-pattern-part-option-list> ==> { pass 1 }
|
||||
|
||||
<literal-pattern-part-option> ::=
|
||||
optional | ==> { OPTIONAL_LSO, - }
|
||||
preamble optional | ==> { PREAMBLE_OPTIONAL_LSO, - }
|
||||
without leading zeros | ==> { WITHOUT_LEADING_ZEROS_LSO, - }
|
||||
...... ==> @<Issue PM_BadLPPartOption problem@>
|
||||
optional | ==> { OPTIONAL_LSO, - }
|
||||
preamble optional | ==> { PREAMBLE_OPTIONAL_LSO, - }
|
||||
without leading zeros | ==> { WITHOUT_LEADING_ZEROS_LSO, - }
|
||||
...... ==> @<Issue PM_BadLPPartOption problem@>
|
||||
|
||||
@<Issue PM_BadLPPartOption problem@> =
|
||||
*X = 0;
|
||||
|
|
|
@ -61,18 +61,18 @@ linguistically the same thing at all.
|
|||
|
||||
=
|
||||
<s-literal-time> ::=
|
||||
minus <elapsed-time> | ==> Rvalues::from_time(-R[1], W)
|
||||
<elapsed-time> | ==> Rvalues::from_time(R[1], W)
|
||||
<clock-time> ==> Rvalues::from_time(R[1], W)
|
||||
minus <elapsed-time> | ==> { -, Rvalues::from_time(-R[1], W) }
|
||||
<elapsed-time> | ==> { -, Rvalues::from_time(R[1], W) }
|
||||
<clock-time> ==> { -, Rvalues::from_time(R[1], W) }
|
||||
|
||||
<elapsed-time> ::=
|
||||
<cardinal-number> hour/hours | ==> 60*R[1]
|
||||
<cardinal-number> minute/minutes | ==> R[1]
|
||||
<cardinal-number> hour/hours <cardinal-number> minute/minutes ==> 60*R[1]+R[2]
|
||||
<cardinal-number> hour/hours | ==> { 60*R[1], - }
|
||||
<cardinal-number> minute/minutes | ==> { pass 1 }
|
||||
<cardinal-number> hour/hours <cardinal-number> minute/minutes ==> { 60*R[1]+R[2], - }
|
||||
|
||||
<clock-time> ::=
|
||||
<cardinal-number> <am-pm> | ==> @<Vet the time for clock range@>
|
||||
<digital-clock-time> <am-pm> ==> @<Vet the time for clock range@>
|
||||
<digital-clock-time> <am-pm> ==> @<Vet the time for clock range@>
|
||||
|
||||
<am-pm> ::=
|
||||
am |
|
||||
|
|
|
@ -66,8 +66,8 @@ the player types either of these:
|
|||
|
||||
=
|
||||
<s-unicode-character> ::=
|
||||
<cardinal-number-unlimited> | ==> Rvalues::from_Unicode_point(R[1], W); if (!(UnicodeTranslations::char_in_range(R[1]))) return FALSE;
|
||||
<unicode-character-name> ==> Rvalues::from_Unicode_point(R[1], W)
|
||||
<cardinal-number-unlimited> | ==> { -, Rvalues::from_Unicode_point(R[1], W) }; if (!(UnicodeTranslations::char_in_range(R[1]))) return FALSE;
|
||||
<unicode-character-name> ==> { -, Rvalues::from_Unicode_point(R[1], W) }
|
||||
|
||||
<unicode-character-name> internal {
|
||||
parse_node *p = Lexicon::retrieve(MISCELLANEOUS_MC, W);
|
||||
|
|
|
@ -136,19 +136,19 @@ as the object.
|
|||
|
||||
=
|
||||
<verb-implies-sentence-subject> ::=
|
||||
in <natural-language> <infinitive-declaration> | ==> R[2]; <<inform_language:nl>> = (inform_language *) (RP[1]);
|
||||
<infinitive-declaration> ==> R[1]; <<inform_language:nl>> = DefaultLanguage::get(NULL);
|
||||
in <natural-language> <infinitive-declaration> | ==> { R[2], -, <<inform_language:nl>> = RP[1] }
|
||||
<infinitive-declaration> ==> { R[1], -, <<inform_language:nl>> = DefaultLanguage::get(NULL) }
|
||||
|
||||
<infinitive-declaration> ::=
|
||||
to <infinitive-usage> ( ... ) | ==> R[1]; <<giving-parts>> = TRUE
|
||||
to <infinitive-usage> | ==> R[1]; <<giving-parts>> = FALSE
|
||||
<infinitive-usage> ( ... ) | ==> R[1]; <<giving-parts>> = TRUE
|
||||
<infinitive-usage> ==> R[1]; <<giving-parts>> = FALSE
|
||||
to <infinitive-usage> ( ... ) | ==> { R[1], -, <<giving-parts>> = TRUE }
|
||||
to <infinitive-usage> | ==> { R[1], -, <<giving-parts>> = FALSE }
|
||||
<infinitive-usage> ( ... ) | ==> { R[1], -, <<giving-parts>> = TRUE }
|
||||
<infinitive-usage> ==> { R[1], -, <<giving-parts>> = FALSE }
|
||||
|
||||
<infinitive-usage> ::=
|
||||
{be able to ...} | ==> { TRUE, - }
|
||||
{be able to} | ==> { TRUE, - }
|
||||
... ==> { FALSE, - }
|
||||
{be able to ...} | ==> { TRUE, - }
|
||||
{be able to} | ==> { TRUE, - }
|
||||
... ==> { FALSE, - }
|
||||
|
||||
@ The text in brackets, if given, is a comma-separated list of conjugations
|
||||
of the verb. Each one is matched against this:
|
||||
|
@ -184,14 +184,14 @@ now absolutely any non-empty word range is accepted as the property name.
|
|||
|
||||
=
|
||||
<verb-implies-sentence-object> ::=
|
||||
reversed <relation-name> relation | ==> REL_VERBM; *XP = BinaryPredicates::get_reversal(RP[1])
|
||||
<relation-name> relation | ==> { REL_VERBM, RP[1] }
|
||||
to <instance-of-infinitive-form> | ==> @<Use verb infinitive as shorthand@>
|
||||
... property | ==> { PROP_VERBM, - }
|
||||
built-in ... meaning | ==> { BUILTIN_VERBM, - }
|
||||
... relation | ==> @<Issue PM_VerbRelationUnknown problem@>
|
||||
{relation} | ==> @<Issue PM_VerbRelationVague problem@>
|
||||
... ==> @<Issue PM_VerbUnknownMeaning problem@>
|
||||
reversed <relation-name> relation | ==> { REL_VERBM, BinaryPredicates::get_reversal(RP[1]) }
|
||||
<relation-name> relation | ==> { REL_VERBM, RP[1] }
|
||||
to <instance-of-infinitive-form> | ==> @<Use verb infinitive as shorthand@>
|
||||
... property | ==> { PROP_VERBM, - }
|
||||
built-in ... meaning | ==> { BUILTIN_VERBM, - }
|
||||
... relation | ==> @<Issue PM_VerbRelationUnknown problem@>
|
||||
{relation} | ==> @<Issue PM_VerbRelationVague problem@>
|
||||
... ==> @<Issue PM_VerbUnknownMeaning problem@>
|
||||
|
||||
@<Issue PM_VerbRelationUnknown problem@> =
|
||||
*X = NONE_VERBM;
|
||||
|
@ -233,13 +233,13 @@ now absolutely any non-empty word range is accepted as the property name.
|
|||
|
||||
=
|
||||
<new-verb-sentence-object> ::=
|
||||
<indefinite-article> <new-verb-sentence-object-unarticled> | ==> { pass 2 }
|
||||
<new-verb-sentence-object-unarticled> ==> { pass 1 }
|
||||
<indefinite-article> <new-verb-sentence-object-unarticled> | ==> { pass 2 }
|
||||
<new-verb-sentence-object-unarticled> ==> { pass 1 }
|
||||
|
||||
<new-verb-sentence-object-unarticled> ::=
|
||||
verb | ==> TRUE; *XP = NULL;
|
||||
verb implying/meaning <definite-article> nounphrase-unparsed> | ==> { TRUE, RP[2] }
|
||||
verb implying/meaning <np-unparsed> ==> { TRUE, RP[1] }
|
||||
verb | ==> { TRUE, NULL }
|
||||
verb implying/meaning <definite-article> nounphrase-unparsed> | ==> { TRUE, RP[2] }
|
||||
verb implying/meaning <np-unparsed> ==> { TRUE, RP[1] }
|
||||
|
||||
@ =
|
||||
int NewVerbs::new_verb_SMF(int task, parse_node *V, wording *NPs) {
|
||||
|
@ -266,13 +266,13 @@ int NewVerbs::new_verb_SMF(int task, parse_node *V, wording *NPs) {
|
|||
|
||||
=
|
||||
<verb-means-sentence-subject> ::=
|
||||
<definite-article> <verb-means-sentence-subject-unarticled> | ==> { pass 2 }
|
||||
<verb-means-sentence-subject-unarticled> ==> { pass 1 }
|
||||
<definite-article> <verb-means-sentence-subject-unarticled> | ==> { pass 2 }
|
||||
<verb-means-sentence-subject-unarticled> ==> { pass 1 }
|
||||
|
||||
<verb-means-sentence-subject-unarticled> ::=
|
||||
verb to | ==> { fail }
|
||||
verb <np-unparsed> in the imperative | ==> { TRUE, RP[1] }
|
||||
verb <np-unparsed> ==> { FALSE, RP[1] }
|
||||
verb to | ==> { fail }
|
||||
verb <np-unparsed> in the imperative | ==> { TRUE, RP[1] }
|
||||
verb <np-unparsed> ==> { FALSE, RP[1] }
|
||||
|
||||
@ =
|
||||
int NewVerbs::verb_means_SMF(int task, parse_node *V, wording *NPs) {
|
||||
|
@ -1121,13 +1121,13 @@ int NewVerbs::takes_contraction_form(word_assemblage *wa) {
|
|||
|
||||
=
|
||||
<new-adjective-sentence-object> ::=
|
||||
<indefinite-article> <new-adjective-sentence-object-unarticled> | ==> { pass 2 }
|
||||
<new-adjective-sentence-object-unarticled> ==> { pass 1 }
|
||||
<indefinite-article> <new-adjective-sentence-object-unarticled> | ==> { pass 2 }
|
||||
<new-adjective-sentence-object-unarticled> ==> { pass 1 }
|
||||
|
||||
<new-adjective-sentence-object-unarticled> ::=
|
||||
adjective | ==> TRUE; *XP = NULL
|
||||
adjective implying/meaning <definite-article> <np-unparsed> | ==> { TRUE, RP[2] }
|
||||
adjective implying/meaning <np-unparsed> ==> { TRUE, RP[1] }
|
||||
adjective | ==> { TRUE, NULL }
|
||||
adjective implying/meaning <definite-article> <np-unparsed> | ==> { TRUE, RP[2] }
|
||||
adjective implying/meaning <np-unparsed> ==> { TRUE, RP[1] }
|
||||
|
||||
@ =
|
||||
int NewVerbs::new_adjective_SMF(int task, parse_node *V, wording *NPs) {
|
||||
|
|
|
@ -304,28 +304,28 @@ to be the name of a kind, possibly in the plural.
|
|||
|
||||
=
|
||||
<relates-sentence-left-object> ::=
|
||||
<relation-term-basic> ( called ... ) | ==> R[1] | CALLED_RBIT
|
||||
<relation-term-basic> ==> { pass 1 }
|
||||
<relation-term-basic> ( called ... ) | ==> { R[1] | CALLED_RBIT, - }
|
||||
<relation-term-basic> ==> { pass 1 }
|
||||
|
||||
<relates-sentence-right-object> ::=
|
||||
<relation-term-right-named> with fast route-finding | ==> R[1] | FRF_RBIT
|
||||
<relation-term-right-named> when ... | ==> R[1] | WHEN_RBIT
|
||||
<relation-term-right-named> ==> { pass 1 }
|
||||
<relation-term-right-named> with fast route-finding | ==> { R[1] | FRF_RBIT, - }
|
||||
<relation-term-right-named> when ... | ==> { R[1] | WHEN_RBIT, - }
|
||||
<relation-term-right-named> ==> { pass 1 }
|
||||
|
||||
<relation-term-right-named> ::=
|
||||
<relation-term-right> ( called ... ) | ==> R[1] | CALLED_RBIT
|
||||
<relation-term-right> ==> { pass 1 }
|
||||
<relation-term-right> ( called ... ) | ==> { R[1] | CALLED_RBIT, - }
|
||||
<relation-term-right> ==> { pass 1 }
|
||||
|
||||
<relation-term-right> ::=
|
||||
{another} | ==> { ANOTHER_RBIT, - }
|
||||
{each other} | ==> { EACHOTHER_RBIT, - }
|
||||
{each other in groups} | ==> { GROUPS_RBIT, - }
|
||||
<relation-term-basic> ==> { pass 1 }
|
||||
{another} | ==> { ANOTHER_RBIT, - }
|
||||
{each other} | ==> { EACHOTHER_RBIT, - }
|
||||
{each other in groups} | ==> { GROUPS_RBIT, - }
|
||||
<relation-term-basic> ==> { pass 1 }
|
||||
|
||||
<relation-term-basic> ::=
|
||||
one ... | ==> { ONE_RBIT, - }
|
||||
various ... | ==> { VAR_RBIT, - }
|
||||
... ==> { 0, - }
|
||||
one ... | ==> { ONE_RBIT, - }
|
||||
various ... | ==> { VAR_RBIT, - }
|
||||
... ==> { 0, - }
|
||||
|
||||
@h The parsing phase.
|
||||
Our aims here are:
|
||||
|
|
|
@ -203,14 +203,14 @@ void Sentences::VPs::switch_dl_mode(parse_node *PN, int sense) {
|
|||
|
||||
@ =
|
||||
<include-in-debugging-sentence-subject> ::=
|
||||
only <debugging-log-request> | ==> R[1] | ONLY_DLR; *XP = RP[1]
|
||||
<debugging-log-request> ==> { pass 1 }
|
||||
only <debugging-log-request> | ==> { R[1] | ONLY_DLR, RP[1] }
|
||||
<debugging-log-request> ==> { pass 1 }
|
||||
|
||||
<debugging-log-request> ::=
|
||||
everything | ==> { EVERYTHING_DLR, - }
|
||||
nothing | ==> { NOTHING_DLR, - }
|
||||
<preform-nonterminal> | ==> { PREFORM_DLR, RP[1] }
|
||||
... ==> { SOMETHING_DLR, - }
|
||||
everything | ==> { EVERYTHING_DLR, NULL }
|
||||
nothing | ==> { NOTHING_DLR, NULL }
|
||||
<preform-nonterminal> | ==> { PREFORM_DLR, RP[1] }
|
||||
... ==> { SOMETHING_DLR, NULL }
|
||||
|
||||
=
|
||||
void Sentences::VPs::set_aspect_from_text(wording W, int new_state) {
|
||||
|
@ -401,16 +401,16 @@ new action.
|
|||
|
||||
=
|
||||
<nounphrase-figure> ::=
|
||||
figure ... ==> 0; *XP = Diagrams::new_UNPARSED_NOUN(W)
|
||||
figure ... ==> { 0, Diagrams::new_UNPARSED_NOUN(W) }
|
||||
|
||||
<nounphrase-sound> ::=
|
||||
sound ... ==> 0; *XP = Diagrams::new_UNPARSED_NOUN(W)
|
||||
sound ... ==> { 0, Diagrams::new_UNPARSED_NOUN(W) }
|
||||
|
||||
<nounphrase-external-file> ::=
|
||||
<external-file-sentence-subject> ==> 0; *XP = Diagrams::new_UNPARSED_NOUN(W)
|
||||
<external-file-sentence-subject> ==> { 0, Diagrams::new_UNPARSED_NOUN(W) }
|
||||
|
||||
<nounphrase-actionable> ::=
|
||||
^<variable-creation-tail> ==> 0; *XP = Diagrams::new_UNPARSED_NOUN(W)
|
||||
^<variable-creation-tail> ==> { 0, Diagrams::new_UNPARSED_NOUN(W) }
|
||||
|
||||
<variable-creation-tail> ::=
|
||||
*** that/which vary/varies |
|
||||
|
@ -420,11 +420,11 @@ new action.
|
|||
|
||||
=
|
||||
<translation-target-unicode> ::=
|
||||
unicode ==> TRUE; *XP = NULL;
|
||||
unicode ==> { TRUE, NULL }
|
||||
|
||||
<translation-target-i6> ::=
|
||||
i6 | ==> TRUE; *XP = NULL;
|
||||
inform 6 ==> TRUE; *XP = NULL;
|
||||
i6 | ==> { TRUE, NULL }
|
||||
inform 6 ==> { TRUE, NULL }
|
||||
|
||||
<translation-target-language> ::=
|
||||
<natural-language> ==> { TRUE, RP[1] }
|
||||
|
|
|
@ -217,8 +217,8 @@ property names before they can do any damage.)
|
|||
{_,/and} <has-properties-called-sentence-object>
|
||||
|
||||
<has-property-name> ::=
|
||||
<bad-property-name-diagnosis> | ==> { 0, - }
|
||||
... ==> 0; Properties::Valued::obtain(W);
|
||||
<bad-property-name-diagnosis> | ==> { 0, - }
|
||||
... ==> { 0, Properties::Valued::obtain(W) }
|
||||
|
||||
<bad-property-name-diagnosis> ::=
|
||||
<article> | ==> @<Issue PM_PropertyCalledArticle problem@>
|
||||
|
|
|
@ -151,8 +151,8 @@ which must match:
|
|||
story
|
||||
|
||||
<episode-sentence-object> ::=
|
||||
episode <cardinal-number> of <quoted-text-without-subs> | ==> R[1]; <<series>> = R[2];
|
||||
episode ... ==> @<Issue PM_BadEpisode problem@>;
|
||||
episode <cardinal-number> of <quoted-text-without-subs> | ==> { R[1], -, <<series>> = R[2] }
|
||||
episode ... ==> @<Issue PM_BadEpisode problem@>;
|
||||
|
||||
@<Issue PM_BadEpisode problem@> =
|
||||
*X = -1;
|
||||
|
|
|
@ -56,26 +56,26 @@ The object noun phrase is an articled list, and each entry must match this.
|
|||
|
||||
=
|
||||
<release-sentence-object> ::=
|
||||
<privacy-indicator> <exposed-innards> | ==> R[2]; <<privacy>> = R[1]
|
||||
<privacy-indicator> ... | ==> @<Issue PM_NoSuchPublicRelease problem@>
|
||||
<exposed-innards> | ==> R[1]; <<privacy>> = NOT_APPLICABLE
|
||||
cover art ( <quoted-text> ) | ==> COVER_ART_PAYLOAD; <<alttext>> = R[1];
|
||||
cover art | ==> COVER_ART_PAYLOAD; <<alttext>> = -1;
|
||||
existing story file | ==> { EXISTING_STORY_FILE_PAYLOAD, - }
|
||||
existing story file called {<quoted-text-without-subs>} | ==> { NAMED_EXISTING_STORY_FILE_PAYLOAD, - }
|
||||
file of {<quoted-text-without-subs>} called {<quoted-text-without-subs>} | ==> { AUXILIARY_FILE_PAYLOAD, - }
|
||||
file {<quoted-text-without-subs>} in {<quoted-text-without-subs>} | ==> { HIDDEN_FILE_IN_PAYLOAD, - }
|
||||
file {<quoted-text-without-subs>} | ==> { HIDDEN_FILE_PAYLOAD, - }
|
||||
style sheet {<quoted-text-without-subs>} | ==> { CSS_PAYLOAD, - }
|
||||
javascript {<quoted-text-without-subs>} | ==> { JAVASCRIPT_PAYLOAD, - }
|
||||
introductory booklet | ==> { BOOKLET_PAYLOAD, - }
|
||||
introductory postcard | ==> { POSTCARD_PAYLOAD, - }
|
||||
website | ==> { WEBSITE_PAYLOAD, - }
|
||||
separate figures | ==> { SEPARATE_FIGURES_PAYLOAD, - }
|
||||
separate sounds | ==> { SEPARATE_SOUNDS_PAYLOAD, - }
|
||||
{<quoted-text-without-subs>} website | ==> { THEMED_WEBSITE_PAYLOAD, - }
|
||||
interpreter | ==> { INTERPRETER_PAYLOAD, - }
|
||||
{<quoted-text-without-subs>} interpreter ==> { THEMED_INTERPRETER_PAYLOAD, - }
|
||||
<privacy-indicator> <exposed-innards> | ==> { R[2], -, <<privacy>> = R[1] }
|
||||
<privacy-indicator> ... | ==> @<Issue PM_NoSuchPublicRelease problem@>
|
||||
<exposed-innards> | ==> { R[1], -, <<privacy>> = NOT_APPLICABLE }
|
||||
cover art ( <quoted-text> ) | ==> { COVER_ART_PAYLOAD, -, <<alttext>> = R[1] }
|
||||
cover art | ==> { COVER_ART_PAYLOAD, -, <<alttext>> = -1 }
|
||||
existing story file | ==> { EXISTING_STORY_FILE_PAYLOAD, - }
|
||||
existing story file called {<quoted-text-without-subs>} | ==> { NAMED_EXISTING_STORY_FILE_PAYLOAD, - }
|
||||
file of {<quoted-text-without-subs>} called {<quoted-text-without-subs>} | ==> { AUXILIARY_FILE_PAYLOAD, - }
|
||||
file {<quoted-text-without-subs>} in {<quoted-text-without-subs>} | ==> { HIDDEN_FILE_IN_PAYLOAD, - }
|
||||
file {<quoted-text-without-subs>} | ==> { HIDDEN_FILE_PAYLOAD, - }
|
||||
style sheet {<quoted-text-without-subs>} | ==> { CSS_PAYLOAD, - }
|
||||
javascript {<quoted-text-without-subs>} | ==> { JAVASCRIPT_PAYLOAD, - }
|
||||
introductory booklet | ==> { BOOKLET_PAYLOAD, - }
|
||||
introductory postcard | ==> { POSTCARD_PAYLOAD, - }
|
||||
website | ==> { WEBSITE_PAYLOAD, - }
|
||||
separate figures | ==> { SEPARATE_FIGURES_PAYLOAD, - }
|
||||
separate sounds | ==> { SEPARATE_SOUNDS_PAYLOAD, - }
|
||||
{<quoted-text-without-subs>} website | ==> { THEMED_WEBSITE_PAYLOAD, - }
|
||||
interpreter | ==> { INTERPRETER_PAYLOAD, - }
|
||||
{<quoted-text-without-subs>} interpreter ==> { THEMED_INTERPRETER_PAYLOAD, - }
|
||||
|
||||
@<Issue PM_NoSuchPublicRelease problem@> =
|
||||
*X = BOOKLET_PAYLOAD; /* to recover harmlessly */
|
||||
|
|
|
@ -342,21 +342,21 @@ itself.
|
|||
|
||||
=
|
||||
<index-map-sentence-subject> ::=
|
||||
eps file | ==> { EPSFILE_IMW, - }
|
||||
<direction-name> mapped as <direction-name> | ==> MAPPED_AS_IMW; <<instance:x>> = RP[1]; <<instance:y>> = RP[2];
|
||||
... mapped as ... | ==> @<Issue PM_MapDirectionClue problem@>
|
||||
<instance-of-object> mapped <map-positioning> | ==> MAPPED_IMW; <<instance:x>> = RP[1]; <<instance:y>> = RP[2];
|
||||
... mapped ... | ==> @<Issue PM_MapPlacement problem@>
|
||||
<map-setting> set to <map-setting-value> | ==> SETTING_IMW; <<scoping>> = R[1]; if (R[1] == NO_IMW) *X = NO_IMW; <<msvtype>> = R[2]
|
||||
<map-setting> set to ... | ==> @<Issue PM_MapSettingTooLong problem@>
|
||||
... set to ... | ==> @<Issue PM_MapSettingOfUnknown problem@>
|
||||
rubric {<quoted-text-without-subs>} *** | ==> { RUBRIC_IMW, - }
|
||||
... ==> @<Issue PM_MapHintUnknown problem@>
|
||||
eps file | ==> { EPSFILE_IMW, - }
|
||||
<direction-name> mapped as <direction-name> | ==> { MAPPED_AS_IMW, -, <<instance:x>> = RP[1], <<instance:y>> = RP[2] }
|
||||
... mapped as ... | ==> @<Issue PM_MapDirectionClue problem@>
|
||||
<instance-of-object> mapped <map-positioning> | ==> { MAPPED_IMW, -, <<instance:x>> = RP[1], <<instance:y>> = RP[2] }
|
||||
... mapped ... | ==> @<Issue PM_MapPlacement problem@>
|
||||
<map-setting> set to <map-setting-value> | ==> { SETTING_IMW, -, <<scoping>> = R[1], <<msvtype>> = R[2] }; if (R[1] == NO_IMW) *X = NO_IMW;
|
||||
<map-setting> set to ... | ==> @<Issue PM_MapSettingTooLong problem@>
|
||||
... set to ... | ==> @<Issue PM_MapSettingOfUnknown problem@>
|
||||
rubric {<quoted-text-without-subs>} *** | ==> { RUBRIC_IMW, - }
|
||||
... ==> @<Issue PM_MapHintUnknown problem@>
|
||||
|
||||
<map-positioning> ::=
|
||||
<instance-of-object> of/from <instance-of-object> | ==> TRUE; <<instance:dir>> = RP[1]; *XP = RP[2]
|
||||
above <instance-of-object> | ==> TRUE; <<instance:dir>> = I_up; *XP = RP[1]
|
||||
below <instance-of-object> ==> TRUE; <<instance:dir>> = I_down; *XP = RP[1]
|
||||
<instance-of-object> of/from <instance-of-object> | ==> { TRUE, RP[2], <<instance:dir>> = RP[1] }
|
||||
above <instance-of-object> | ==> { TRUE, RP[1], <<instance:dir>> = I_up }
|
||||
below <instance-of-object> ==> { TRUE, RP[1], <<instance:dir>> = I_down }
|
||||
|
||||
@<Issue PM_MapDirectionClue problem@> =
|
||||
*X = NO_IMW;
|
||||
|
@ -404,19 +404,19 @@ itself.
|
|||
|
||||
=
|
||||
<map-setting> ::=
|
||||
<map-parameter> of <map-setting-scope> | ==> R[2]; <<wchar_t:partext>> = RP[1]; <<parindex>> = R[1]
|
||||
<map-parameter> | ==> ENTIRE_MAP_SCOPE; <<wchar_t:partext>> = RP[1]; <<parindex>> = R[1]
|
||||
... of <map-setting-scope> ==> @<Issue PM_MapSettingUnknown problem@>
|
||||
<map-parameter> of <map-setting-scope> | ==> { R[2], -, <<wchar_t:partext>> = RP[1], <<parindex>> = R[1] }
|
||||
<map-parameter> | ==> { ENTIRE_MAP_SCOPE, -, <<wchar_t:partext>> = RP[1], <<parindex>> = R[1] }
|
||||
... of <map-setting-scope> ==> @<Issue PM_MapSettingUnknown problem@>
|
||||
|
||||
<map-setting-scope> ::=
|
||||
<definite-article> <map-setting-scope-unarticled> | ==> { pass 2 }
|
||||
<map-setting-scope-unarticled> ==> { pass 1 }
|
||||
<definite-article> <map-setting-scope-unarticled> | ==> { pass 2 }
|
||||
<map-setting-scope-unarticled> ==> { pass 1 }
|
||||
|
||||
<map-setting-scope-unarticled> ::=
|
||||
first room | ==> { FIRST_ROOM_MAP_SCOPE, - }
|
||||
level <cardinal-number> | ==> LEVEL_MAP_SCOPE; <<level>> = R[1]
|
||||
<k-kind> | ==> KIND_MAP_SCOPE; <<kind:kscope>> = RP[1]
|
||||
<instance-of-object> ==> INSTANCE_MAP_SCOPE; <<instance:iscope>> = RP[1]
|
||||
first room | ==> { FIRST_ROOM_MAP_SCOPE, - }
|
||||
level <cardinal-number> | ==> { LEVEL_MAP_SCOPE, -, <<level>> = R[1] }
|
||||
<k-kind> | ==> { KIND_MAP_SCOPE, -, <<kind:kscope>> = RP[1] }
|
||||
<instance-of-object> ==> { INSTANCE_MAP_SCOPE, -, <<instance:iscope>> = RP[1] }
|
||||
|
||||
@ The map parameters all have one-word, sometimes hyphenated, names, such
|
||||
as the following:
|
||||
|
@ -454,15 +454,15 @@ Never mind.
|
|||
|
||||
=
|
||||
<map-setting-value> ::=
|
||||
<cardinal-number> | ==> INT_MDT; <<msvalue>> = R[1]; <<msword>> = Wordings::first_wn(W);
|
||||
<quoted-text> | ==> TEXT_MDT; <<msvalue>> = R[1]; <<msword>> = Wordings::first_wn(W);
|
||||
<map-setting-boolean> | ==> BOOL_MDT; <<msvalue>> = R[1]; <<msword>> = Wordings::first_wn(W);
|
||||
<map-offset> | ==> OFF_MDT; <<msvalue>> = R[1]; <<msword>> = Wordings::first_wn(W); if (R[1] == ERRONEOUS_OFFSET_VALUE) return FALSE;
|
||||
### ==> -1; <<msword>> = Wordings::first_wn(W); /* leads to a problem message later */
|
||||
<cardinal-number> | ==> { INT_MDT, -, <<msvalue>> = R[1], <<msword>> = Wordings::first_wn(W) }
|
||||
<quoted-text> | ==> { TEXT_MDT, -, <<msvalue>> = R[1], <<msword>> = Wordings::first_wn(W) }
|
||||
<map-setting-boolean> | ==> { BOOL_MDT, -, <<msvalue>> = R[1], <<msword>> = Wordings::first_wn(W) }
|
||||
<map-offset> | ==> { OFF_MDT, -, <<msvalue>> = R[1], <<msword>> = Wordings::first_wn(W) }; if (R[1] == ERRONEOUS_OFFSET_VALUE) return FALSE;
|
||||
### ==> { -1, -, <<msword>> = Wordings::first_wn(W) } /* leads to a problem message later */
|
||||
|
||||
<map-setting-boolean> ::=
|
||||
on | ==> { TRUE, - }
|
||||
off ==> { FALSE, - }
|
||||
on | ==> { TRUE, - }
|
||||
off ==> { FALSE, - }
|
||||
|
||||
@ Map offsets have a cutesy notation: |10&-30|, for example, written as a
|
||||
single word. The following nonterminal actually matches any single word
|
||||
|
@ -481,11 +481,11 @@ the following:
|
|||
|
||||
=
|
||||
<map-rubric> ::=
|
||||
size <cardinal-number> *** | ==> RUBRIC_SIZE; <<rsize>> = R[1]; <<edge>> = Wordings::first_wn(WR[1])
|
||||
font {<quoted-text-without-subs>} *** | ==> RUBRIC_FONT; <<rfont>> = R[1]; <<edge>> = Wordings::first_wn(WR[2])
|
||||
colour {<quoted-text-without-subs>} *** | ==> RUBRIC_COLOUR; <<rcol>> = R[1]; <<edge>> = Wordings::first_wn(WR[2])
|
||||
at <map-offset> from ... | ==> RUBRIC_OFFSET; <<roff>> = R[1]; <<edge>> = Wordings::first_wn(WR[1])
|
||||
at <map-offset> *** ==> RUBRIC_POSITION; <<roff>> = R[1]; <<edge>> = Wordings::first_wn(WR[1])
|
||||
size <cardinal-number> *** | ==> { RUBRIC_SIZE, -, <<rsize>> = R[1], <<edge>> = Wordings::first_wn(WR[1]) }
|
||||
font {<quoted-text-without-subs>} *** | ==> { RUBRIC_FONT, -, <<rfont>> = R[1], <<edge>> = Wordings::first_wn(WR[2]) }
|
||||
colour {<quoted-text-without-subs>} *** | ==> { RUBRIC_COLOUR, -, <<rcol>> = R[1], <<edge>> = Wordings::first_wn(WR[2]) }
|
||||
at <map-offset> from ... | ==> { RUBRIC_OFFSET, -, <<roff>> = R[1], <<edge>> = Wordings::first_wn(WR[1]) }
|
||||
at <map-offset> *** ==> { RUBRIC_POSITION, -, <<roff>> = R[1], <<edge>> = Wordings::first_wn(WR[1]) }
|
||||
|
||||
@
|
||||
|
||||
|
|
|
@ -389,14 +389,14 @@ in a different context, for instance, and could still be valid in that case.
|
|||
|
||||
=
|
||||
<scene-ends-sentence-object> ::=
|
||||
<text-including-a-calling> | ==> @<Issue PM_ScenesDisallowCalled problem@>
|
||||
play begins | ==> { -1, - }
|
||||
play ends | ==> @<Issue PM_ScenesNotPlay problem@>
|
||||
<scene-name> begins | ==> 0; <<scene:named>> = RP[1]
|
||||
<scene-name> ends | ==> 1; <<scene:named>> = RP[1]
|
||||
<scene-name> ends <scene-end-name> | ==> R[2]; <<scene:named>> = RP[1]
|
||||
<text-including-a-calling> | ==> @<Issue PM_ScenesDisallowCalled problem@>
|
||||
play begins | ==> { -1, - }
|
||||
play ends | ==> @<Issue PM_ScenesNotPlay problem@>
|
||||
<scene-name> begins | ==> { 0, -, <<scene:named>> = RP[1] }
|
||||
<scene-name> ends | ==> { 1, -, <<scene:named>> = RP[1] }
|
||||
<scene-name> ends <scene-end-name> | ==> { R[2], -, <<scene:named>> = RP[1] }
|
||||
<scene-name> ends ... | ==> @<Issue PM_ScenesUnknownEnd problem@>
|
||||
<s-condition> ==> -2; <<parse_node:cond>> = RP[1]
|
||||
<s-condition> ==> { -2, -, <<parse_node:cond>> = RP[1] }
|
||||
|
||||
@<Issue PM_ScenesDisallowCalled problem@> =
|
||||
*X = -1;
|
||||
|
|
|
@ -695,10 +695,10 @@ a condition attached with "when":
|
|||
|
||||
=
|
||||
<ap-common-core> ::=
|
||||
<ap-common-core-inner> when/while <condition-in-ap> | ==> { 0, RP[1] }; action_pattern *ap = *XP; ap->when = RP[2]; if (pap_failure_reason == MISC_PAPF) pap_failure_reason = WHENOKAY_PAPF;
|
||||
<ap-common-core-inner> | ==> { 0, RP[1] };
|
||||
... when/while <condition-in-ap> | ==> 0; pap_failure_reason = WHENOKAY_PAPF; return FALSE; /* used only to diagnose problems */
|
||||
... when/while ... ==> 0; if (pap_failure_reason != WHENOKAY_PAPF) pap_failure_reason = WHEN_PAPF; return FALSE; /* used only to diagnose problems */
|
||||
<ap-common-core-inner> when/while <condition-in-ap> | ==> { 0, RP[1] }; action_pattern *ap = *XP; ap->when = RP[2]; if (pap_failure_reason == MISC_PAPF) pap_failure_reason = WHENOKAY_PAPF;
|
||||
<ap-common-core-inner> | ==> { 0, RP[1] };
|
||||
... when/while <condition-in-ap> | ==> { 0, NULL }; pap_failure_reason = WHENOKAY_PAPF; return FALSE; /* used only to diagnose problems */
|
||||
... when/while ... ==> { 0, NULL }; if (pap_failure_reason != WHENOKAY_PAPF) pap_failure_reason = WHEN_PAPF; return FALSE; /* used only to diagnose problems */
|
||||
|
||||
@ <condition-in-ap> is really just <spec-condition> in disguise -- i.e.,
|
||||
it matches a standard Inform condition -- but it's implemented as an internal
|
||||
|
|
|
@ -767,8 +767,8 @@ action to be created.
|
|||
|
||||
=
|
||||
<action-sentence-subject> ::=
|
||||
<action-name> | ==> @<Issue PM_ActionAlreadyExists problem@>
|
||||
... ==> 0; *XP = PL::Actions::act_new(W, TRUE);
|
||||
<action-name> | ==> @<Issue PM_ActionAlreadyExists problem@>
|
||||
... ==> { 0, PL::Actions::act_new(W, TRUE) }
|
||||
|
||||
@<Issue PM_ActionAlreadyExists problem@> =
|
||||
*XP = NULL;
|
||||
|
@ -793,50 +793,50 @@ It's convenient to define a single action clause first:
|
|||
|
||||
=
|
||||
<action-clause> ::=
|
||||
out of world | ==> { OOW_ACT_CLAUSE, - }
|
||||
abbreviable | ==> { ABBREV_ACT_CLAUSE, - }
|
||||
with past participle ... | ==> { PP_ACT_CLAUSE, - }
|
||||
applying to <action-applications> | ==> APPLYING_ACT_CLAUSE; <<num>> = R[1]
|
||||
requiring light ==> { LIGHT_ACT_CLAUSE, - }
|
||||
out of world | ==> { OOW_ACT_CLAUSE, - }
|
||||
abbreviable | ==> { ABBREV_ACT_CLAUSE, - }
|
||||
with past participle ... | ==> { PP_ACT_CLAUSE, - }
|
||||
applying to <action-applications> | ==> { APPLYING_ACT_CLAUSE, -, <<num>> = R[1] }
|
||||
requiring light ==> { LIGHT_ACT_CLAUSE, - }
|
||||
|
||||
<action-applications> ::=
|
||||
nothing | ==> { 0, - }
|
||||
one <act-req> and one <act-req> | ==> 2; <<kind:op1>> = RP[1]; <<ac1>> = R[1]; <<kind:op2>> = RP[2]; <<ac2>> = R[2]
|
||||
one <act-req> and <act-req> | ==> 2; <<kind:op1>> = RP[1]; <<ac1>> = R[1]; <<kind:op2>> = RP[2]; <<ac2>> = R[2]
|
||||
<act-req> and one <act-req> | ==> 2; <<kind:op1>> = RP[1]; <<ac1>> = R[1]; <<kind:op2>> = RP[2]; <<ac2>> = R[2]
|
||||
<act-req> and <act-req> | ==> 2; <<kind:op1>> = RP[1]; <<ac1>> = R[1]; <<kind:op2>> = RP[2]; <<ac2>> = R[2]
|
||||
nothing or one <act-req> | ==> -1; <<kind:op1>> = RP[1]; <<ac1>> = R[1]
|
||||
one <act-req> | ==> 1; <<kind:op1>> = RP[1]; <<ac1>> = R[1]
|
||||
two <act-req> | ==> 2; <<kind:op1>> = RP[1]; <<ac1>> = R[1]; <<kind:op2>> = RP[1]; <<ac2>> = R[1]
|
||||
<act-req> | ==> 1; <<kind:op1>> = RP[1]; <<ac1>> = R[1]
|
||||
... ==> @<Issue PM_ActionMisapplied problem@>;
|
||||
nothing | ==> { 0, - }
|
||||
one <act-req> and one <act-req> | ==> { 2, -, <<kind:op1>> = RP[1], <<ac1>> = R[1], <<kind:op2>> = RP[2], <<ac2>> = R[2] }
|
||||
one <act-req> and <act-req> | ==> { 2, -, <<kind:op1>> = RP[1], <<ac1>> = R[1], <<kind:op2>> = RP[2], <<ac2>> = R[2] }
|
||||
<act-req> and one <act-req> | ==> { 2, -, <<kind:op1>> = RP[1], <<ac1>> = R[1], <<kind:op2>> = RP[2], <<ac2>> = R[2] }
|
||||
<act-req> and <act-req> | ==> { 2, -, <<kind:op1>> = RP[1], <<ac1>> = R[1], <<kind:op2>> = RP[2], <<ac2>> = R[2] }
|
||||
nothing or one <act-req> | ==> { -1, -, <<kind:op1>> = RP[1], <<ac1>> = R[1] }
|
||||
one <act-req> | ==> { 1, -, <<kind:op1>> = RP[1], <<ac1>> = R[1] }
|
||||
two <act-req> | ==> { 2, -, <<kind:op1>> = RP[1], <<ac1>> = R[1], <<kind:op2>> = RP[1], <<ac2>> = R[1] }
|
||||
<act-req> | ==> { 1, -, <<kind:op1>> = RP[1], <<ac1>> = R[1] }
|
||||
... ==> @<Issue PM_ActionMisapplied problem@>;
|
||||
|
||||
<act-req> ::=
|
||||
<action-access> <k-kind> | ==> { R[1], RP[2] }; @<Check action kind@>;
|
||||
<k-kind> ==> { UNRESTRICTED_ACCESS, RP[1] }; @<Check action kind@>;
|
||||
<action-access> <k-kind> | ==> { R[1], RP[2] }; @<Check action kind@>;
|
||||
<k-kind> ==> { UNRESTRICTED_ACCESS, RP[1] }; @<Check action kind@>;
|
||||
|
||||
<action-access> ::=
|
||||
visible | ==> { DOESNT_REQUIRE_ACCESS, - }
|
||||
touchable | ==> { REQUIRES_ACCESS, - }
|
||||
carried ==> { REQUIRES_POSSESSION, - }
|
||||
visible | ==> { DOESNT_REQUIRE_ACCESS, - }
|
||||
touchable | ==> { REQUIRES_ACCESS, - }
|
||||
carried ==> { REQUIRES_POSSESSION, - }
|
||||
|
||||
@ We are now able to define this peculiar form of list of action clauses:
|
||||
|
||||
=
|
||||
<action-sentence-object> ::=
|
||||
<action-clauses> | ==> { 0, - }
|
||||
... ==> @<Issue PM_ActionClauseUnknown problem@>
|
||||
<action-clauses> | ==> { 0, - }
|
||||
... ==> @<Issue PM_ActionClauseUnknown problem@>
|
||||
|
||||
<action-clauses> ::=
|
||||
... | ==> 0; return preform_lookahead_mode; /* match only on lookahead */
|
||||
<action-clauses> <action-clause-terminated> | ==> R[2]; @<Act on this action information@>
|
||||
<action-clause-terminated> ==> R[1]; @<Act on this action information@>
|
||||
... | ==> { lookahead }
|
||||
<action-clauses> <action-clause-terminated> | ==> { R[2], - }; @<Act on this action information@>
|
||||
<action-clause-terminated> ==> { R[1], - }; @<Act on this action information@>
|
||||
|
||||
<action-clause-terminated> ::=
|
||||
<action-clause> , and | ==> { pass 1 }
|
||||
<action-clause> and | ==> { pass 1 }
|
||||
<action-clause> , | ==> { pass 1 }
|
||||
<action-clause> ==> { pass 1 }
|
||||
<action-clause> , and | ==> { pass 1 }
|
||||
<action-clause> and | ==> { pass 1 }
|
||||
<action-clause> , | ==> { pass 1 }
|
||||
<action-clause> ==> { pass 1 }
|
||||
|
||||
@<Issue PM_ActionClauseUnknown problem@> =
|
||||
StandardProblems::sentence_problem(Task::syntax_tree(), _p_(PM_ActionClauseUnknown),
|
||||
|
|
|
@ -179,9 +179,9 @@ known what the action will be.
|
|||
|
||||
=
|
||||
<understand-condition> ::=
|
||||
<s-non-action-condition> | ==> 0; <<parse_node:cond>> = RP[1];
|
||||
<s-condition> | ==> @<Issue PM_WhenAction problem@>
|
||||
... ==> @<Issue PM_BadWhen problem@>;
|
||||
<s-non-action-condition> | ==> { 0, -, <<parse_node:cond>> = RP[1] }
|
||||
<s-condition> | ==> @<Issue PM_WhenAction problem@>
|
||||
... ==> @<Issue PM_BadWhen problem@>;
|
||||
|
||||
@<Issue PM_WhenAction problem@> =
|
||||
StandardProblems::sentence_problem(Task::syntax_tree(), _p_(PM_WhenAction),
|
||||
|
|
|
@ -83,13 +83,13 @@ the Standard Rules or, in the case of "the X understood", by Inform itself.
|
|||
|
||||
=
|
||||
<notable-parsing-variables> ::=
|
||||
<k-kind> understood | ==> 0; <<kind:understood>> = RP[1]
|
||||
noun | ==> { 1, - }
|
||||
location | ==> { 2, - }
|
||||
actor-location | ==> { 3, - }
|
||||
second noun | ==> { 4, - }
|
||||
person asked | ==> { 5, - }
|
||||
maximum score ==> { 6, - }
|
||||
<k-kind> understood | ==> { 0, -, <<kind:understood>> = RP[1] }
|
||||
noun | ==> { 1, - }
|
||||
location | ==> { 2, - }
|
||||
actor-location | ==> { 3, - }
|
||||
second noun | ==> { 4, - }
|
||||
person asked | ==> { 5, - }
|
||||
maximum score ==> { 6, - }
|
||||
|
||||
@ =
|
||||
int PL::Parsing::Visibility::parsing_new_variable_notify(nonlocal_variable *var) {
|
||||
|
|
|
@ -219,38 +219,38 @@ kind *PL::Parsing::Tokens::kind_for_special_token(int gtc) {
|
|||
|
||||
=
|
||||
<grammar-token> ::=
|
||||
<named-grammar-token> | ==> NAMED_TOKEN_GTC; <<grammar_verb:named>> = RP[1]
|
||||
any things | ==> ANY_THINGS_GTC; <<parse_node:s>> = Specifications::from_kind(K_thing);
|
||||
any <s-description> | ==> ANY_STUFF_GTC; <<parse_node:s>> = RP[1]
|
||||
anything | ==> ANY_STUFF_GTC; <<parse_node:s>> = Specifications::from_kind(K_thing);
|
||||
anybody | ==> ANY_STUFF_GTC; <<parse_node:s>> = Specifications::from_kind(K_person);
|
||||
anyone | ==> ANY_STUFF_GTC; <<parse_node:s>> = Specifications::from_kind(K_person);
|
||||
anywhere | ==> ANY_STUFF_GTC; <<parse_node:s>> = Specifications::from_kind(K_room);
|
||||
something related by reversed <relation-name> | ==> RELATED_GTC; *XP = BinaryPredicates::get_reversal(RP[1])
|
||||
something related by <relation-name> | ==> { RELATED_GTC, RP[1] }
|
||||
something related by ... | ==> @<Issue PM_GrammarBadRelation problem@>
|
||||
<standard-grammar-token> | ==> R[1]
|
||||
<definite-article> <k-kind> | ==> STUFF_GTC; <<parse_node:s>> = Specifications::from_kind(RP[2])
|
||||
<s-description> | ==> STUFF_GTC; <<parse_node:s>> = RP[1]
|
||||
<s-type-expression> | ==> @<Issue PM_BizarreToken problem@>
|
||||
... ==> @<Issue PM_UnknownToken problem@>
|
||||
<named-grammar-token> | ==> { NAMED_TOKEN_GTC, -, <<grammar_verb:named>> = RP[1] }
|
||||
any things | ==> { ANY_THINGS_GTC, -, <<parse_node:s>> = Specifications::from_kind(K_thing) }
|
||||
any <s-description> | ==> { ANY_STUFF_GTC, -, <<parse_node:s>> = RP[1] }
|
||||
anything | ==> { ANY_STUFF_GTC, -, <<parse_node:s>> = Specifications::from_kind(K_thing) }
|
||||
anybody | ==> { ANY_STUFF_GTC, -, <<parse_node:s>> = Specifications::from_kind(K_person) }
|
||||
anyone | ==> { ANY_STUFF_GTC, -, <<parse_node:s>> = Specifications::from_kind(K_person) }
|
||||
anywhere | ==> { ANY_STUFF_GTC, -, <<parse_node:s>> = Specifications::from_kind(K_room) }
|
||||
something related by reversed <relation-name> | ==> { RELATED_GTC, BinaryPredicates::get_reversal(RP[1]) }
|
||||
something related by <relation-name> | ==> { RELATED_GTC, RP[1] }
|
||||
something related by ... | ==> @<Issue PM_GrammarBadRelation problem@>
|
||||
<standard-grammar-token> | ==> { R[1], NULL }
|
||||
<definite-article> <k-kind> | ==> { STUFF_GTC, -, <<parse_node:s>> = Specifications::from_kind(RP[2]) }
|
||||
<s-description> | ==> { STUFF_GTC, -, <<parse_node:s>> = RP[1] }
|
||||
<s-type-expression> | ==> @<Issue PM_BizarreToken problem@>
|
||||
... ==> @<Issue PM_UnknownToken problem@>
|
||||
|
||||
<standard-grammar-token> ::=
|
||||
something | ==> { NOUN_TOKEN_GTC, - }
|
||||
things | ==> { MULTI_TOKEN_GTC, - }
|
||||
things inside | ==> { MULTIINSIDE_TOKEN_GTC, - }
|
||||
things preferably held | ==> { MULTIHELD_TOKEN_GTC, - }
|
||||
something preferably held | ==> { HELD_TOKEN_GTC, - }
|
||||
other things | ==> { MULTIEXCEPT_TOKEN_GTC, - }
|
||||
someone | ==> { CREATURE_TOKEN_GTC, - }
|
||||
somebody | ==> { CREATURE_TOKEN_GTC, - }
|
||||
text | ==> { TOPIC_TOKEN_GTC, - }
|
||||
topic | ==> @<Issue PM_UseTextNotTopic problem@>
|
||||
a topic | ==> @<Issue PM_UseTextNotTopic problem@>
|
||||
object | ==> @<Issue PM_UseThingNotObject problem@>
|
||||
an object | ==> @<Issue PM_UseThingNotObject problem@>
|
||||
something held | ==> @<Issue something held problem message@>
|
||||
things held ==> @<Issue things held problem message@>
|
||||
something | ==> { NOUN_TOKEN_GTC, - }
|
||||
things | ==> { MULTI_TOKEN_GTC, - }
|
||||
things inside | ==> { MULTIINSIDE_TOKEN_GTC, - }
|
||||
things preferably held | ==> { MULTIHELD_TOKEN_GTC, - }
|
||||
something preferably held | ==> { HELD_TOKEN_GTC, - }
|
||||
other things | ==> { MULTIEXCEPT_TOKEN_GTC, - }
|
||||
someone | ==> { CREATURE_TOKEN_GTC, - }
|
||||
somebody | ==> { CREATURE_TOKEN_GTC, - }
|
||||
text | ==> { TOPIC_TOKEN_GTC, - }
|
||||
topic | ==> @<Issue PM_UseTextNotTopic problem@>
|
||||
a topic | ==> @<Issue PM_UseTextNotTopic problem@>
|
||||
object | ==> @<Issue PM_UseThingNotObject problem@>
|
||||
an object | ==> @<Issue PM_UseThingNotObject problem@>
|
||||
something held | ==> @<Issue something held problem message@>
|
||||
things held ==> @<Issue things held problem message@>
|
||||
|
||||
<named-grammar-token> internal {
|
||||
grammar_verb *gv = PL::Parsing::Verbs::named_token_by_name(W);
|
||||
|
|
|
@ -140,11 +140,11 @@ As examples:
|
|||
|
||||
=
|
||||
<understand-sentence-subject> ::=
|
||||
nothing | ==> NOTHING_UNDERSTAND_FORM; *XP = NULL
|
||||
<understand-property-list> | ==> { PROPERTY_UNDERSTAND_FORM, RP[1] }
|
||||
the command/commands <understand-regular-list> | ==> { COMMAND_UNDERSTAND_FORM, RP[1] }
|
||||
the verb/verbs ... | ==> @<Issue PM_OldVerbUsage problem@>
|
||||
<understand-regular-list> ==> { GRAMMAR_UNDERSTAND_FORM, RP[1] }
|
||||
nothing | ==> { NOTHING_UNDERSTAND_FORM, NULL }
|
||||
<understand-property-list> | ==> { PROPERTY_UNDERSTAND_FORM, RP[1] }
|
||||
the command/commands <understand-regular-list> | ==> { COMMAND_UNDERSTAND_FORM, RP[1] }
|
||||
the verb/verbs ... | ==> @<Issue PM_OldVerbUsage problem@>
|
||||
<understand-regular-list> ==> { GRAMMAR_UNDERSTAND_FORM, RP[1] }
|
||||
|
||||
@<Issue PM_OldVerbUsage problem@> =
|
||||
*X = NO_UNDERSTAND_FORM;
|
||||
|
@ -160,33 +160,33 @@ As examples:
|
|||
|
||||
=
|
||||
<understand-regular-list> ::=
|
||||
... | ==> 0; *XP = NULL; return preform_lookahead_mode; /* match only when looking ahead */
|
||||
<understand-regular-entry> <understand-regular-tail> | ==> @<Compose understand item list@>
|
||||
<understand-regular-entry> ==> { 0, RP[1] };
|
||||
... | ==> { lookahead }
|
||||
<understand-regular-entry> <understand-regular-tail> | ==> @<Compose understand item list@>
|
||||
<understand-regular-entry> ==> { 0, RP[1] }
|
||||
|
||||
<understand-regular-tail> ::=
|
||||
, _and/or <understand-regular-list> | ==> { 0, RP[1] };
|
||||
_,/and/or <understand-regular-list> ==> { 0, RP[1] };
|
||||
, _and/or <understand-regular-list> | ==> { 0, RP[1] }
|
||||
_,/and/or <understand-regular-list> ==> { 0, RP[1] }
|
||||
|
||||
<understand-regular-entry> ::=
|
||||
... ==> @<Make understand item@>
|
||||
... ==> @<Make understand item@>
|
||||
|
||||
@ In the third case, the subject NP is a list of property names written in the
|
||||
formal way (with "property").
|
||||
|
||||
=
|
||||
<understand-property-list> ::=
|
||||
... | ==> 0; *XP = NULL; return preform_lookahead_mode; /* match only when looking ahead */
|
||||
<understand-property-entry> <understand-property-tail> | ==> @<Compose understand item list@>
|
||||
<understand-property-entry> ==> { 0, RP[1] };
|
||||
... | ==> { lookahead }
|
||||
<understand-property-entry> <understand-property-tail> | ==> @<Compose understand item list@>
|
||||
<understand-property-entry> ==> { 0, RP[1] }
|
||||
|
||||
<understand-property-tail> ::=
|
||||
, _and/or <understand-property-list> | ==> { 0, RP[1] };
|
||||
_,/and/or <understand-property-list> ==> { 0, RP[1] };
|
||||
, _and/or <understand-property-list> | ==> { 0, RP[1] }
|
||||
_,/and/or <understand-property-list> ==> { 0, RP[1] }
|
||||
|
||||
<understand-property-entry> ::=
|
||||
<property-name> property | ==> @<Make understand property item@>
|
||||
... property ==> @<Issue PM_UnknownUnderstandProperty problem@>
|
||||
<property-name> property | ==> @<Make understand property item@>
|
||||
... property ==> @<Issue PM_UnknownUnderstandProperty problem@>
|
||||
|
||||
@<Issue PM_UnknownUnderstandProperty problem@> =
|
||||
if (!preform_lookahead_mode)
|
||||
|
@ -239,20 +239,20 @@ It's not widely known, but the object phrase here can be a list.
|
|||
|
||||
=
|
||||
<understand-sentence-object> ::=
|
||||
<understand-sentence-object-uncond> when/while ... | ==> { 2, RP[1] }
|
||||
<understand-sentence-object-uncond> ==> { 1, RP[1] }
|
||||
<understand-sentence-object-uncond> when/while ... | ==> { 2, RP[1] }
|
||||
<understand-sentence-object-uncond> ==> { 1, RP[1] }
|
||||
|
||||
<understand-sentence-object-uncond> ::=
|
||||
... | ==> 0; return preform_lookahead_mode; /* match only when looking ahead */
|
||||
<understand-sentence-entry> <understand-sentence-object-tail> | ==> @<Compose understand reference list@>
|
||||
<understand-sentence-entry> ==> { 0, RP[1] }
|
||||
... | ==> { lookahead }
|
||||
<understand-sentence-entry> <understand-sentence-object-tail> | ==> @<Compose understand reference list@>
|
||||
<understand-sentence-entry> ==> { 0, RP[1] }
|
||||
|
||||
<understand-sentence-object-tail> ::=
|
||||
, _and/or <understand-sentence-object-uncond> | ==> { 0, RP[1] }
|
||||
_,/and/or <understand-sentence-object-uncond> ==> { 0, RP[1] }
|
||||
, _and/or <understand-sentence-object-uncond> | ==> { 0, RP[1] }
|
||||
_,/and/or <understand-sentence-object-uncond> ==> { 0, RP[1] }
|
||||
|
||||
<understand-sentence-entry> ::=
|
||||
<understand-as-this> ==> 0; if (!preform_lookahead_mode) @<Deal with UT vars@>;
|
||||
<understand-as-this> ==> { 0, - }; if (!preform_lookahead_mode) @<Deal with UT vars@>;
|
||||
|
||||
@<Compose understand reference list@> =
|
||||
understanding_reference *ui1 = RP[1];
|
||||
|
@ -277,21 +277,21 @@ It's not widely known, but the object phrase here can be a list.
|
|||
|
||||
=
|
||||
<understand-as-this> ::=
|
||||
... | ==> 0; @<Clear UT vars@>; return preform_lookahead_mode; /* match only when looking ahead */
|
||||
a mistake | ==> 0; ur_being_parsed.gv_result = GV_IS_COMMAND; ur_being_parsed.mistaken = TRUE;
|
||||
a mistake ( <quoted-text> ) | ==> 0; ur_being_parsed.gv_result = GV_IS_COMMAND; ur_being_parsed.mistaken = TRUE; ur_being_parsed.mword = R[1]
|
||||
a mistake ... | ==> @<Issue PM_TextlessMistake problem@>
|
||||
the plural of <understand-ref> | ==> R[1]; ur_being_parsed.pluralised_reference = TRUE;
|
||||
plural of <understand-ref> | ==> R[1]; ur_being_parsed.pluralised_reference = TRUE;
|
||||
<quoted-text> | ==> 0; ur_being_parsed.gv_result = GV_IS_TOKEN;
|
||||
<understand-ref> ( with nouns reversed ) | ==> R[1]; ur_being_parsed.reversed_reference = TRUE;
|
||||
<understand-ref> ==> { pass 1 }
|
||||
... | ==> { 0, - }; @<Clear UT vars@>; return preform_lookahead_mode; /* match only when looking ahead */
|
||||
a mistake | ==> { 0, - }; ur_being_parsed.gv_result = GV_IS_COMMAND; ur_being_parsed.mistaken = TRUE;
|
||||
a mistake ( <quoted-text> ) | ==> { 0, - }; ur_being_parsed.gv_result = GV_IS_COMMAND; ur_being_parsed.mistaken = TRUE; ur_being_parsed.mword = R[1]
|
||||
a mistake ... | ==> @<Issue PM_TextlessMistake problem@>
|
||||
the plural of <understand-ref> | ==> { R[1], - }; ur_being_parsed.pluralised_reference = TRUE;
|
||||
plural of <understand-ref> | ==> { R[1], - }; ur_being_parsed.pluralised_reference = TRUE;
|
||||
<quoted-text> | ==> { 0, - }; ur_being_parsed.gv_result = GV_IS_TOKEN;
|
||||
<understand-ref> ( with nouns reversed ) | ==> { R[1], - }; ur_being_parsed.reversed_reference = TRUE;
|
||||
<understand-ref> ==> { pass 1 }
|
||||
|
||||
<understand-ref> ::=
|
||||
<action-name> | ==> 0; ur_being_parsed.an_reference = RP[1];
|
||||
<s-descriptive-type-expression> | ==> 0; ur_being_parsed.spec_reference = RP[1];
|
||||
<s-variable> | ==> @<Issue PM_UnderstandVariable problem@>
|
||||
... ==> @<Issue PM_UnderstandVague problem@>
|
||||
<action-name> | ==> { 0, - }; ur_being_parsed.an_reference = RP[1];
|
||||
<s-descriptive-type-expression> | ==> { 0, - }; ur_being_parsed.spec_reference = RP[1];
|
||||
<s-variable> | ==> @<Issue PM_UnderstandVariable problem@>
|
||||
... ==> @<Issue PM_UnderstandVague problem@>
|
||||
|
||||
@<Clear UT vars@> =
|
||||
ur_being_parsed.reference_text = W;
|
||||
|
@ -350,10 +350,10 @@ Here the grammar is very simple, and the object can't be a list.
|
|||
|
||||
=
|
||||
<understand-command-sentence-object> ::=
|
||||
... when/while ... | ==> @<Issue PM_UnderstandCommandWhen problem@>
|
||||
something new | ==> { 0, - }
|
||||
<quoted-text> | ==> Wordings::first_wn(W)
|
||||
... ==> @<Issue PM_NotOldCommand problem@>
|
||||
... when/while ... | ==> @<Issue PM_UnderstandCommandWhen problem@>
|
||||
something new | ==> { 0, - }
|
||||
<quoted-text> | ==> { Wordings::first_wn(W), - }
|
||||
... ==> @<Issue PM_NotOldCommand problem@>
|
||||
|
||||
@<Issue PM_UnderstandCommandWhen problem@> =
|
||||
*X = -1;
|
||||
|
@ -375,18 +375,18 @@ to or described can be of any kind, but in fact we restrict to kinds of object.
|
|||
|
||||
=
|
||||
<understand-property-sentence-object> ::=
|
||||
<understand-property-sentence-object-unconditional> when/while ... | ==> { 2, RP[1] }; <<level>> = R[1]
|
||||
<understand-property-sentence-object-unconditional> ==> { 1, RP[1] }; <<level>> = R[1]
|
||||
<understand-property-sentence-object-unconditional> when/while ... | ==> { 2, RP[1], <<level>> = R[1] }
|
||||
<understand-property-sentence-object-unconditional> ==> { 1, RP[1], <<level>> = R[1] }
|
||||
|
||||
<understand-property-sentence-object-unconditional> ::=
|
||||
referring to <understand-property-reference> | ==> { 1, RP[1] }
|
||||
referring to <understand-property-reference> | ==> { 1, RP[1] }
|
||||
describing <understand-property-reference> | ==> { 2, RP[1] }
|
||||
... ==> @<Issue PM_BadUnderstandProperty problem@>
|
||||
|
||||
<understand-property-reference> ::=
|
||||
<k-kind> | ==> @<Make reference from kind, if a kind of object@>
|
||||
<instance-of-object> | ==> 0; *XP = Instances::as_subject(RP[1]);
|
||||
... ==> @<Issue PM_BadUnderstandPropertyAs problem@>
|
||||
<k-kind> | ==> @<Make reference from kind, if a kind of object@>
|
||||
<instance-of-object> | ==> { 0, Instances::as_subject(RP[1]) }
|
||||
... ==> @<Issue PM_BadUnderstandPropertyAs problem@>
|
||||
|
||||
@<Make reference from kind, if a kind of object@> =
|
||||
kind *K = RP[1];
|
||||
|
|
|
@ -76,19 +76,19 @@ Here is the subject:
|
|||
|
||||
=
|
||||
<external-file-sentence-subject> ::=
|
||||
<definite-article> <external-file-sentence-subject> | ==> { pass 2 }
|
||||
text <external-file-name> | ==> FALSE; <<ownership>> = R[1]
|
||||
binary <external-file-name> | ==> TRUE; <<ownership>> = R[1]
|
||||
<external-file-name> ==> FALSE; <<ownership>> = R[1]
|
||||
<definite-article> <external-file-sentence-subject> | ==> { pass 2 }
|
||||
text <external-file-name> | ==> { FALSE, -, <<ownership>> = R[1] }
|
||||
binary <external-file-name> | ==> { TRUE, -, <<ownership>> = R[1] }
|
||||
<external-file-name> ==> { FALSE, -, <<ownership>> = R[1] }
|
||||
|
||||
<external-file-name> ::=
|
||||
{file ...} ( owned by <external-file-owner> ) | ==> { pass 1 }
|
||||
{file ...} ==> { NOT_APPLICABLE, - }
|
||||
{file ...} ( owned by <external-file-owner> ) | ==> { pass 1 }
|
||||
{file ...} ==> { NOT_APPLICABLE, - }
|
||||
|
||||
<external-file-owner> ::=
|
||||
another project | ==> { FALSE, - }
|
||||
project {<quoted-text-without-subs>} | ==> { TRUE, - }
|
||||
... ==> @<Issue PM_BadFileOwner problem@>
|
||||
another project | ==> { FALSE, - }
|
||||
project {<quoted-text-without-subs>} | ==> { TRUE, - }
|
||||
... ==> @<Issue PM_BadFileOwner problem@>
|
||||
|
||||
@<Issue PM_BadFileOwner problem@> =
|
||||
*X = NOT_APPLICABLE;
|
||||
|
@ -110,8 +110,8 @@ letters or digits, with the first being a letter.
|
|||
|
||||
=
|
||||
<external-file-sentence-object> ::=
|
||||
<quoted-text> | ==> { pass 1 }
|
||||
... ==> @<Issue PM_FilenameNotTextual problem@>
|
||||
<quoted-text> | ==> { pass 1 }
|
||||
... ==> @<Issue PM_FilenameNotTextual problem@>
|
||||
|
||||
@<Issue PM_FilenameNotTextual problem@> =
|
||||
*X = -1;
|
||||
|
@ -123,11 +123,11 @@ letters or digits, with the first being a letter.
|
|||
|
||||
=
|
||||
<new-file-sentence-object> ::=
|
||||
<indefinite-article> <new-file-sentence-object-unarticled> | ==> { pass 2 }
|
||||
<new-file-sentence-object-unarticled> ==> { pass 1 }
|
||||
<indefinite-article> <new-file-sentence-object-unarticled> | ==> { pass 2 }
|
||||
<new-file-sentence-object-unarticled> ==> { pass 1 }
|
||||
|
||||
<new-file-sentence-object-unarticled> ::=
|
||||
called <np-unparsed> ==> { TRUE, RP[1] }
|
||||
called <np-unparsed> ==> { TRUE, RP[1] }
|
||||
|
||||
@ =
|
||||
int PL::Files::new_file_SMF(int task, parse_node *V, wording *NPs) {
|
||||
|
|
|
@ -109,13 +109,13 @@ int PL::Figures::new_figure_SMF(int task, parse_node *V, wording *NPs) {
|
|||
|
||||
@ =
|
||||
<figure-sentence-object> ::=
|
||||
<figure-source> ( <quoted-text> ) | ==> R[1]; <<alttext>> = R[2];
|
||||
<figure-source> ==> { pass 1 }
|
||||
<figure-source> ( <quoted-text> ) | ==> { R[1], -, <<alttext>> = R[2] }
|
||||
<figure-source> ==> { pass 1 }
|
||||
|
||||
<figure-source> ::=
|
||||
of cover art | ==> { -1, - }
|
||||
<quoted-text> | ==> { pass 1 }
|
||||
... ==> @<Issue PM_PictureNotTextual problem@>;
|
||||
of cover art | ==> { -1, - }
|
||||
<quoted-text> | ==> { pass 1 }
|
||||
... ==> @<Issue PM_PictureNotTextual problem@>;
|
||||
|
||||
@<Issue PM_PictureNotTextual problem@> =
|
||||
StandardProblems::sentence_problem(Task::syntax_tree(), _p_(PM_PictureNotTextual),
|
||||
|
|
|
@ -103,7 +103,7 @@ int PL::Sounds::new_sound_SMF(int task, parse_node *V, wording *NPs) {
|
|||
|
||||
=
|
||||
<sound-sentence-object> ::=
|
||||
<sound-source> ( <quoted-text> ) | ==> R[1]; <<alttext>> = R[2];
|
||||
<sound-source> ( <quoted-text> ) | ==> { R[1], -, <<alttext>> = R[2] }
|
||||
<sound-source> ==> { pass 1 }
|
||||
|
||||
<sound-source> ::=
|
||||
|
|
Loading…
Reference in a new issue