![]() |
Vcsn
2.3a
Be Rational
|
Parser of snames. More...
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 | |
int | peek_ () |
The next character, possibly preceded by spaces. More... | |
char | eat_ (char c) |
Accept this character, possibly preceded by spaces. More... | |
const std::string & | eat_ (const std::string &s) |
Accept this string, possibly preceded by spaces. More... | |
void | check_eof_ (std::shared_ptr< ast_node > res) |
We managed to read res in is, check that is_ is finished. More... | |
std::string | word_ () |
The next word in the stream. More... | |
std::string | parameters_ () |
The next parameters in the stream. More... | |
std::shared_ptr< ast_node > | any_ () |
Accept anything. More... | |
std::shared_ptr< const genset > | genset_ () |
An optional generator set in brackets (e.g., <char_letters(abc)> or <char> ). More... | |
std::shared_ptr< const genset > | genset_ (std::string letter_type) |
A generator set (e.g., char_letters(abc) or char ). More... | |
std::shared_ptr< context > | context_ () |
<LabelSet>, <WeightSet> . More... | |
std::shared_ptr< context > | context_ (std::string w) |
<LabelSet>, <WeightSet> . More... | |
std::shared_ptr< ast_node > | labelset_ () |
<LabelSet> . More... | |
std::shared_ptr< ast_node > | labelset_ (const std::string &ls) |
<LabelSet> . More... | |
std::shared_ptr< ast_node > | weightset_ () |
<WeightSet> . More... | |
std::shared_ptr< ast_node > | weightset_ (const std::string &ws) |
<WeightSet> . More... | |
std::shared_ptr< automaton > | automaton_ () |
<Automaton> "\<" <Context> "\>" . More... | |
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 &w) |
<LabelSet> | <WeightSet> More... | |
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... | |
Parser of snames.
Definition at line 18 of file context-parser.cc.
|
inline |
Definition at line 21 of file context-parser.cc.
|
inlineprivate |
Accept anything.
Definition at line 121 of file context-parser.cc.
References automaton_(), context_(), expansionset_(), expressionset_(), vcsn::has(), labelset_(), labelsets_, parameters_(), peek_(), polynomialset_(), vcsn::res, seriesset_(), tuple_(), tupleset_(), weightset_(), weightsets_, and word_().
Referenced by automaton_(), parse(), and tuple_().
|
inlineprivate |
<Automaton> "\<" <Context> "\>"
.
Definition at line 295 of file context-parser.cc.
References word_().
Referenced by any_(), and automaton_().
|
inlineprivate |
<Automaton> "\<" <Context> "\>"
.
Definition at line 301 of file context-parser.cc.
References any_(), automaton_(), context_(), eat_(), expressionset_(), peek_(), vcsn::prefix(), vcsn::res, vcsn::str_escape(), and word_().
|
inlineprivate |
We managed to read res in is, check that is_
is finished.
Definition at line 65 of file context-parser.cc.
References vcsn::fail_reading(), is_, and peek_().
Referenced by parse(), and parse_context().
|
inlineprivate |
<LabelSet>, <WeightSet>
.
Definition at line 203 of file context-parser.cc.
References word_().
Referenced by any_(), automaton_(), expressionset_(), parse_context(), polynomialset_(), and seriesset_().
|
inlineprivate |
<LabelSet>, <WeightSet>
.
Definition at line 209 of file context-parser.cc.
References eat_(), labelset_(), weightset_(), and word_().
Accept this character, possibly preceded by spaces.
Definition at line 50 of file context-parser.cc.
References vcsn::eat(), is_, and vcsn::skip_space().
Referenced by automaton_(), context_(), expansionset_(), expressionset_(), genset_(), labelset_(), parameters_(), polynomialset_(), seriesset_(), tuple_(), and tupleset_().
|
inlineprivate |
Accept this string, possibly preceded by spaces.
Definition at line 57 of file context-parser.cc.
References vcsn::eat(), is_, and vcsn::skip_space().
|
inlineprivate |
"expansionset" "\<" <Expressionset> "\>"
.
Definition at line 445 of file context-parser.cc.
References eat_(), expressionset_(), and vcsn::res.
Referenced by any_().
|
inlineprivate |
"expressionset" "\<" <Context> "\>"
, possibly followed by identities.
Definition at line 419 of file context-parser.cc.
References context_(), eat_(), vcsn::rat::ids(), is_, and peek_().
Referenced by any_(), automaton_(), expansionset_(), labelset_(), labelset_or_weightset_(), and weightset_().
|
inlineprivate |
An optional generator set in brackets (e.g., <char_letters(abc)>
or <char>
).
Defaults to <char>
if the stream does not start with <
.
Definition at line 163 of file context-parser.cc.
References eat_(), peek_(), vcsn::res, and word_().
Referenced by labelset_().
|
inlineprivate |
A generator set (e.g., char_letters(abc)
or char
).
letter_type | should be char_letter , or char , etc. |
Definition at line 178 of file context-parser.cc.
References is_, peek_(), and vcsn::require().
|
inlineprivate |
<LabelSet>
.
Definition at line 227 of file context-parser.cc.
References word_().
Referenced by any_(), context_(), labelset_(), and labelset_or_weightset_().
|
inlineprivate |
<LabelSet>
.
Definition at line 233 of file context-parser.cc.
References eat_(), expressionset_(), genset_(), labelset_(), vcsn::res, seriesset_(), vcsn::str_escape(), and tupleset_().
|
inlineprivate |
<LabelSet> | <WeightSet>
Definition at line 464 of file context-parser.cc.
References word_().
Referenced by tupleset_().
|
inlineprivate |
<LabelSet> | <WeightSet>
Definition at line 470 of file context-parser.cc.
References expressionset_(), vcsn::has(), labelset_(), labelsets_, seriesset_(), tupleset_(), weightset_(), and weightsets_.
|
inlineprivate |
|
inline |
Accept anything.
Definition at line 26 of file context-parser.cc.
References any_(), check_eof_(), and vcsn::res.
Referenced by vcsn::ast::parse_type().
|
inline |
Accept only a valid context.
Definition at line 34 of file context-parser.cc.
References check_eof_(), context_(), and vcsn::res.
Referenced by vcsn::ast::parse_context().
|
inlineprivate |
The next character, possibly preceded by spaces.
Definition at line 43 of file context-parser.cc.
References is_, and vcsn::skip_space().
Referenced by any_(), automaton_(), check_eof_(), expressionset_(), genset_(), parameters_(), tuple_(), and tupleset_().
|
inlineprivate |
"polynomialset" "\<" <Context> "\>"
.
Definition at line 455 of file context-parser.cc.
References context_(), eat_(), and vcsn::res.
Referenced by any_(), and weightset_().
|
inlineprivate |
No optional argument.
Definition at line 435 of file context-parser.cc.
References context_(), vcsn::rat::identities::distributive, and eat_().
Referenced by any_(), labelset_(), labelset_or_weightset_(), and weightset_().
|
inlineprivate |
|
inlineprivate |
"\<" (<LabelSet> | <WeightSet> ",")+ "\>"
.
Definition at line 404 of file context-parser.cc.
References eat_(), labelset_or_weightset_(), peek_(), and vcsn::res.
Referenced by any_(), labelset_(), labelset_or_weightset_(), and weightset_().
|
inlineprivate |
<WeightSet>
.
Definition at line 272 of file context-parser.cc.
References word_().
Referenced by any_(), context_(), and labelset_or_weightset_().
|
inlineprivate |
<WeightSet>
.
Definition at line 278 of file context-parser.cc.
References expressionset_(), vcsn::has(), polynomialset_(), seriesset_(), vcsn::str_escape(), tupleset_(), and weightsets_.
|
inlineprivate |
The next word in the stream.
Does not consider that underscore is word-constituent. Skips spaces.
Definition at line 80 of file context-parser.cc.
References is_, vcsn::res, and vcsn::skip_space().
Referenced by any_(), automaton_(), context_(), genset_(), labelset_(), labelset_or_weightset_(), and weightset_().
|
private |
The stream we are parsing.
Definition at line 487 of file context-parser.cc.
Referenced by check_eof_(), eat_(), expressionset_(), genset_(), parameters_(), peek_(), and word_().
|
private |
The set of weightset names.
Definition at line 505 of file context-parser.cc.
Referenced by any_(), and labelset_or_weightset_().
|
private |
The set of terminal weightset names.
Definition at line 490 of file context-parser.cc.
Referenced by any_(), labelset_or_weightset_(), and weightset_().