diff --git a/libwccl/parser/grammar.g b/libwccl/parser/grammar.g index ef49f4ba784381f0bbd1f44db753dbdc4b4256d5..cd33823cf73faef150e026a42d2261ef5d5936b5 100644 --- a/libwccl/parser/grammar.g +++ b/libwccl/parser/grammar.g @@ -276,7 +276,7 @@ parse_match_rule /////////////////////////////////////////////////////////////////////////////// // ---------------------------------------------------------------------------- -// Single or muliple (comma separated) elements in string set, may be: +// Single or multiple (comma separated) elements in string set, may be: // 'a' "a" [] ['a'] ['a', 'b'] ["a"] ["a", "b"] ['a', "b"] // Parsing strset literal and returning plain strset value. // Returns boost::shared_ptr<StrSet> @@ -301,7 +301,7 @@ strset_literal )? RBRACKET ; -// String set value as constrant string set: +// String set value as a constant string set: // Returns boost::shared_ptr<Constant<StrSet> > strset_value returns [boost::shared_ptr<Constant<StrSet> > val] @@ -314,8 +314,8 @@ strset_value ; // ---------------------------------------------------------------------------- -// Element of sym set. This rule, inserts element into symbol set -// with corresponding tagset. +// Element of sym set. This rule inserts element into symbol set +// using corresponding tagset. // WARNING! This rule can throw ParserException! Be careful! symset_elem [const Corpus2::Tagset& tagset, boost::shared_ptr<TSet>& t_set] @@ -552,8 +552,9 @@ position_variable // ---------------------------------------------------------------------------- // String set, $s:name -// This expression gets (however, before put into) variable of the type StrSet -// from scope -- variables. +// This expression gets variable of StrSet type from the scope's Variables. +// Creates one first if it's not yet there. +// // Returns boost::shared_ptr<VariableAccessor<StrSet> > strset_variable_acc [Variables& vars] @@ -583,7 +584,9 @@ strset_variable // ---------------------------------------------------------------------------- // Symbol set: $t:name -// Get symset variable (however, before put into) from variables +// This expression gets variable of TSet type from the scope's Variables. +// Creates one first if it's not there yet. +// // Returns boost::shared_ptr<VariableAccessor<TSet> > symset_variable_acc [Variables& vars] @@ -613,7 +616,8 @@ symset_variable // ---------------------------------------------------------------------------- // Bool: $b:name -// Get bool variable (however, before put into) from variables +// This expression gets variable of Bool type from the scope's Variables. +// Creates one first if it's not there yet. // Returns boost::shared_ptr<VariableAccessor<Bool> > bool_variable_acc [Variables& vars] @@ -643,7 +647,8 @@ bool_variable // ---------------------------------------------------------------------------- // Match: $m:name -// Get mach vector variable from variavles (before put into variables) +// This expression gets variable of Match type from the scope's Variables. +// Creates one first if it's not there yet. // Returns boost::shared_ptr<VariableAccessor<Match> > match_vector_variable_acc [Variables& vars] @@ -658,7 +663,7 @@ match_vector_variable_acc } ; -// Vargetter for the match vector variavle. Wrapper for match_vector_variable_acc +// Vargetter for the match vector variable. Wrapper for match_vector_variable_acc // Returns boost::shared_ptr<VarGetter<Match> > match_vector_variable [Variables& vars] @@ -917,7 +922,7 @@ position_last_token [const Corpus2::Tagset& tagset, Variables& vars] ; /////////////////////////////////////////////////////////////////////////////// -// Stiring operator +// String operator // Returns boost::shared_ptr<Function<StrSet> > /////////////////////////////////////////////////////////////////////////////// strset_operator [const Corpus2::Tagset& tagset, Variables& vars] @@ -1002,7 +1007,7 @@ strset_affix ; // ---------------------------------------------------------------------------- -// Wrapper ofr strset value and strset variable +// A wrapper for strset value and strset variable strset_var_val [const Corpus2::Tagset& /*tagset*/, Variables& vars] returns [boost::shared_ptr<Function<StrSet> > op] @@ -1041,7 +1046,7 @@ strset_condition ; /////////////////////////////////////////////////////////////////////////////// -// Boool operator +// Bool operator // Returns boost::shared_ptr<Function<Bool> > /////////////////////////////////////////////////////////////////////////////// bool_operator @@ -1755,7 +1760,7 @@ match_operator } | LPAREN ret = match_operator [tagset, vars] RPAREN ) - ( // if there's an arrow after the match, we have a submatch reference + ( // if there's a colon after the match, we have a submatch reference COLON i: UNSIGNED_INT { ret.reset(new Submatch(ret, token_ref_to_int(i))); } )* ;