Vcsn
2.1
Be Rational
|
#include <context-parser.hh>
Public Member Functions | |
context_parser (std::istringstream &is) | |
std::shared_ptr< ast_node > | parse () |
Accept anything. More... | |
std::shared_ptr< ast_node > | parse_context () |
Accept only a valid context. More... | |
Private Member Functions | |
std::shared_ptr< ast_node > | any_ () |
Accept anything. More... | |
std::string | word_ () |
The next word in the stream. More... | |
std::string | parameters_ () |
The next parameters in the stream. More... | |
std::shared_ptr< const genset > | genset_ () |
A generator set (e.g., char_letters(abc) or char ). More... | |
std::shared_ptr< const genset > | genset_ (std::string letter_type) |
std::shared_ptr< context > | context_ () |
<LabelSet>, <WeightSet> . More... | |
std::shared_ptr< context > | context_ (std::string word) |
std::shared_ptr< ast_node > | labelset_ () |
<LabelSet> . More... | |
std::shared_ptr< ast_node > | labelset_ (const std::string &kind) |
std::shared_ptr< ast_node > | weightset_ () |
<WeightSet> . More... | |
std::shared_ptr< ast_node > | weightset_ (const std::string &ws) |
std::shared_ptr< automaton > | automaton_ (std::string prefix) |
<Automaton> "\<" <Context> "\>" . More... | |
std::shared_ptr< tuple > | tuple_ () |
"\<" (<Any> ",")* "\>" . More... | |
std::shared_ptr< tupleset > | tupleset_ () |
"\<" (<LabelSet> | <WeightSet> ",")+ "\>" . More... | |
std::shared_ptr< expressionset > | expressionset_ () |
"expressionset" "\<" <Context> "\>" , possibly followed by identities. More... | |
std::shared_ptr< expressionset > | seriesset_ () |
No optional argument. More... | |
std::shared_ptr< expansionset > | expansionset_ () |
"expansionset" "\<" <Expressionset> "\>" . More... | |
std::shared_ptr< polynomialset > | polynomialset_ () |
"polynomialset" "\<" <Context> "\>" . More... | |
std::shared_ptr< ast_node > | labelset_or_weightset_ () |
<LabelSet> | <WeightSet> More... | |
std::shared_ptr< ast_node > | labelset_or_weightset_ (const std::string &kind) |
Private Attributes | |
std::istringstream & | is_ |
The stream we are parsing. More... | |
std::set< std::string > | weightsets_ |
The set of terminal weightset names. More... | |
std::set< std::string > | labelsets_ |
The set of weightset names. More... | |
Definition at line 15 of file context-parser.hh.
|
inline |
Definition at line 18 of file context-parser.hh.
|
private |
Accept anything.
Definition at line 42 of file context-parser.cc.
References automaton_(), context_(), expansionset_(), expressionset_(), vcsn::has(), is_, labelset_(), labelsets_, parameters_(), polynomialset_(), seriesset_(), tuple_(), tupleset_(), weightset_(), weightsets_, and word_().
Referenced by parse(), and tuple_().
|
private |
<Automaton> "\<" <Context> "\>"
.
Definition at line 291 of file context-parser.cc.
References context_(), vcsn::eat(), is_, vcsn::prefix(), vcsn::str_escape(), and word_().
Referenced by any_().
|
private |
<LabelSet>, <WeightSet>
.
Definition at line 185 of file context-parser.cc.
References word_().
Referenced by any_(), automaton_(), expressionset_(), parse_context(), polynomialset_(), and seriesset_().
|
private |
Definition at line 191 of file context-parser.cc.
References vcsn::eat(), is_, labelset_(), weightset_(), and word_().
|
private |
"expansionset" "\<" <Expressionset> "\>"
.
Definition at line 406 of file context-parser.cc.
References vcsn::eat(), expressionset_(), and is_.
Referenced by any_().
|
private |
"expressionset" "\<" <Context> "\>"
, possibly followed by identities.
Definition at line 381 of file context-parser.cc.
References context_(), vcsn::eat(), vcsn::rat::ids(), and is_.
Referenced by any_(), expansionset_(), labelset_(), labelset_or_weightset_(), and weightset_().
|
private |
A generator set (e.g., char_letters(abc)
or char
).
Definition at line 180 of file context-parser.cc.
References word_().
Referenced by labelset_().
|
private |
Definition at line 156 of file context-parser.cc.
References is_, and vcsn::require().
|
private |
<LabelSet>
.
Definition at line 210 of file context-parser.cc.
References word_().
Referenced by any_(), context_(), labelset_(), and labelset_or_weightset_().
|
private |
Definition at line 216 of file context-parser.cc.
References vcsn::eat(), expressionset_(), genset_(), is_, labelset_(), seriesset_(), vcsn::str_escape(), and tupleset_().
|
private |
<LabelSet> | <WeightSet>
Definition at line 97 of file context-parser.cc.
References word_().
Referenced by tupleset_().
|
private |
Definition at line 103 of file context-parser.cc.
References expressionset_(), vcsn::has(), labelset_(), labelsets_, seriesset_(), tupleset_(), weightset_(), and weightsets_.
|
private |
The next parameters in the stream.
Must be right before the opening <
. Will return up to the matching >
.
Definition at line 136 of file context-parser.cc.
References vcsn::eat(), and is_.
Referenced by any_().
std::shared_ptr< ast_node > vcsn::ast::context_parser::parse | ( | ) |
Accept anything.
Definition at line 28 of file context-parser.cc.
References any_(), vcsn::ast::check_eof(), and is_.
std::shared_ptr< ast_node > vcsn::ast::context_parser::parse_context | ( | ) |
Accept only a valid context.
Definition at line 35 of file context-parser.cc.
References vcsn::ast::check_eof(), context_(), and is_.
Referenced by vcsn::ast::normalize_context().
|
private |
"polynomialset" "\<" <Context> "\>"
.
Definition at line 415 of file context-parser.cc.
References context_(), vcsn::eat(), and is_.
Referenced by any_(), and weightset_().
|
private |
No optional argument.
Definition at line 397 of file context-parser.cc.
References context_(), vcsn::rat::identities::distributive, vcsn::eat(), and is_.
Referenced by any_(), labelset_(), labelset_or_weightset_(), and weightset_().
|
private |
"\<" (<Any> ",")* "\>"
.
Definition at line 351 of file context-parser.cc.
References any_(), vcsn::eat(), and is_.
Referenced by any_().
|
private |
"\<" (<LabelSet> | <WeightSet> ",")+ "\>"
.
Definition at line 366 of file context-parser.cc.
References vcsn::eat(), is_, and labelset_or_weightset_().
Referenced by any_(), labelset_(), labelset_or_weightset_(), and weightset_().
|
private |
<WeightSet>
.
Definition at line 268 of file context-parser.cc.
References word_().
Referenced by any_(), context_(), and labelset_or_weightset_().
|
private |
Definition at line 274 of file context-parser.cc.
References expressionset_(), vcsn::has(), polynomialset_(), seriesset_(), vcsn::str_escape(), tupleset_(), and weightsets_.
|
private |
The next word in the stream.
Does not consider that underscore is word-constituent.
Definition at line 119 of file context-parser.cc.
References is_.
Referenced by any_(), automaton_(), context_(), genset_(), labelset_(), labelset_or_weightset_(), and weightset_().
|
private |
The stream we are parsing.
Definition at line 80 of file context-parser.hh.
Referenced by any_(), automaton_(), context_(), expansionset_(), expressionset_(), genset_(), labelset_(), parameters_(), parse(), parse_context(), polynomialset_(), seriesset_(), tuple_(), tupleset_(), and word_().
|
private |
The set of weightset names.
Definition at line 98 of file context-parser.hh.
Referenced by any_(), and labelset_or_weightset_().
|
private |
The set of terminal weightset names.
Definition at line 83 of file context-parser.hh.
Referenced by any_(), labelset_or_weightset_(), and weightset_().