Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vcsn::ast::context_parser Class Reference

#include <context-parser.hh>

Collaboration diagram for vcsn::ast::context_parser:

Public Member Functions

 context_parser (std::istringstream &is)
 
std::shared_ptr< ast_nodeparse ()
 Accept anything. More...
 
std::shared_ptr< ast_nodeparse_context ()
 Accept only a valid context. More...
 

Private Member Functions

std::shared_ptr< ast_nodeany_ ()
 Accept anything. More...
 
std::string word_ ()
 Return the next word in the stream. More...
 
std::shared_ptr< const gensetgenset_ ()
 A generator set (e.g., "char(abc)" or "char"). More...
 
std::shared_ptr< const gensetgenset_ (const std::string &letter_type)
 
std::shared_ptr< contextcontext_ ()
 <LabelSet>, <WeightSet>. More...
 
std::shared_ptr< contextcontext_ (const std::string &word)
 
std::shared_ptr< contextcontext_ (const std::shared_ptr< ast_node > &ls)
 When the labelset was already parsed. More...
 
std::shared_ptr< ast_nodelabelset_ ()
 <LabelSet>. More...
 
std::shared_ptr< ast_nodelabelset_ (const std::string &kind)
 
std::shared_ptr< ast_nodeweightset_ ()
 <WeightSet>. More...
 
std::shared_ptr< ast_nodeweightset_ (const std::string &ws)
 
std::shared_ptr< automatonautomaton_ (std::string prefix)
 <Automaton> "\<" <Context> "\>". More...
 
std::shared_ptr< tuplesettupleset_ ()
 
std::shared_ptr< ratexpsetratexpset_ ()
 "ratexpset" "\<" <Context> "\>". More...
 
std::shared_ptr< ratexpsetratexpset_series_ ()
 
std::shared_ptr< polynomialsetpolynomialset_ ()
 "polynomialset" "\<" <Context> "\>". More...
 
std::shared_ptr< ast_nodelabelset_or_weightset_ ()
 <LabelSet> | <WeightSet> More...
 
std::shared_ptr< ast_nodelabelset_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...
 

Detailed Description

Definition at line 16 of file context-parser.hh.

Constructor & Destructor Documentation

vcsn::ast::context_parser::context_parser ( std::istringstream &  is)
inline

Definition at line 19 of file context-parser.hh.

Member Function Documentation

std::shared_ptr< ast_node > vcsn::ast::context_parser::any_ ( )
private

Accept anything.

Definition at line 42 of file context-parser.cc.

References automaton_(), context_(), vcsn::eat(), vcsn::has(), is_, labelset_(), labelsets_, tupleset_(), weightset_(), weightsets_, and word_().

Referenced by parse().

Here is the call graph for this function:

std::shared_ptr< automaton > vcsn::ast::context_parser::automaton_ ( std::string  prefix)
private

<Automaton> "\<" <Context> "\>".

Definition at line 260 of file context-parser.cc.

References context_(), vcsn::eat(), is_, vcsn::prefix(), vcsn::str_escape(), and word_().

Referenced by any_().

Here is the call graph for this function:

std::shared_ptr< context > vcsn::ast::context_parser::context_ ( )
private

<LabelSet>, <WeightSet>.

Definition at line 168 of file context-parser.cc.

References word_().

Referenced by any_(), automaton_(), context_(), parse_context(), polynomialset_(), ratexpset_(), and ratexpset_series_().

Here is the call graph for this function:

std::shared_ptr< context > vcsn::ast::context_parser::context_ ( const std::string &  word)
private

Definition at line 183 of file context-parser.cc.

References context_(), and labelset_().

Here is the call graph for this function:

std::shared_ptr< context > vcsn::ast::context_parser::context_ ( const std::shared_ptr< ast_node > &  ls)
private

When the labelset was already parsed.

Definition at line 174 of file context-parser.cc.

References vcsn::eat(), is_, and weightset_().

Here is the call graph for this function:

std::shared_ptr< const genset > vcsn::ast::context_parser::genset_ ( )
private

A generator set (e.g., "char(abc)" or "char").

Definition at line 163 of file context-parser.cc.

References word_().

Referenced by labelset_().

Here is the call graph for this function:

std::shared_ptr< const genset > vcsn::ast::context_parser::genset_ ( const std::string &  letter_type)
private

Definition at line 146 of file context-parser.cc.

References is_.

std::shared_ptr< ast_node > vcsn::ast::context_parser::labelset_ ( )
private

<LabelSet>.

Definition at line 188 of file context-parser.cc.

References word_().

Referenced by any_(), context_(), labelset_(), and labelset_or_weightset_().

Here is the call graph for this function:

std::shared_ptr< ast_node > vcsn::ast::context_parser::labelset_ ( const std::string &  kind)
private

Definition at line 194 of file context-parser.cc.

References vcsn::eat(), genset_(), is_, labelset_(), ratexpset_(), ratexpset_series_(), vcsn::str_escape(), and tupleset_().

Here is the call graph for this function:

std::shared_ptr< ast_node > vcsn::ast::context_parser::labelset_or_weightset_ ( )
private

<LabelSet> | <WeightSet>

Definition at line 106 of file context-parser.cc.

References word_().

Referenced by tupleset_().

Here is the call graph for this function:

std::shared_ptr< ast_node > vcsn::ast::context_parser::labelset_or_weightset_ ( const std::string &  kind)
private

Definition at line 112 of file context-parser.cc.

References vcsn::has(), labelset_(), labelsets_, ratexpset_(), ratexpset_series_(), tupleset_(), weightset_(), and weightsets_.

Here is the call graph for this function:

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_.

Referenced by vcsn::ast::normalize().

Here is the call graph for this function:

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_.

Here is the call graph for this function:

std::shared_ptr< polynomialset > vcsn::ast::context_parser::polynomialset_ ( )
private

"polynomialset" "\<" <Context> "\>".

Definition at line 355 of file context-parser.cc.

References context_(), vcsn::eat(), and is_.

Referenced by weightset_().

Here is the call graph for this function:

std::shared_ptr< ratexpset > vcsn::ast::context_parser::ratexpset_ ( )
private

"ratexpset" "\<" <Context> "\>".

Definition at line 331 of file context-parser.cc.

References context_(), vcsn::eat(), is_, and vcsn::rat::trivial.

Referenced by labelset_(), labelset_or_weightset_(), and weightset_().

Here is the call graph for this function:

std::shared_ptr< ratexpset > vcsn::ast::context_parser::ratexpset_series_ ( )
private

Definition at line 347 of file context-parser.cc.

References context_(), vcsn::eat(), is_, and vcsn::rat::series.

Referenced by labelset_(), labelset_or_weightset_(), and weightset_().

Here is the call graph for this function:

std::shared_ptr< tupleset > vcsn::ast::context_parser::tupleset_ ( )
private

Definition at line 316 of file context-parser.cc.

References vcsn::eat(), is_, and labelset_or_weightset_().

Referenced by any_(), labelset_(), labelset_or_weightset_(), and weightset_().

Here is the call graph for this function:

std::shared_ptr< ast_node > vcsn::ast::context_parser::weightset_ ( )
private

<WeightSet>.

Definition at line 237 of file context-parser.cc.

References word_().

Referenced by any_(), context_(), and labelset_or_weightset_().

Here is the call graph for this function:

std::shared_ptr< ast_node > vcsn::ast::context_parser::weightset_ ( const std::string &  ws)
private

Definition at line 243 of file context-parser.cc.

References vcsn::has(), polynomialset_(), ratexpset_(), ratexpset_series_(), vcsn::str_escape(), tupleset_(), and weightsets_.

Here is the call graph for this function:

std::string vcsn::ast::context_parser::word_ ( )
private

Return the next word in the stream.

Does not consider that underscore is word-constituent.

Definition at line 128 of file context-parser.cc.

References is_.

Referenced by any_(), automaton_(), context_(), genset_(), labelset_(), labelset_or_weightset_(), and weightset_().

Member Data Documentation

std::istringstream& vcsn::ast::context_parser::is_
private
std::set<std::string> vcsn::ast::context_parser::labelsets_
private
Initial value:
=
{
"lal_char",
"lan",
"lan_char",
"lao",
"law_char",
"letterset",
"wordset",
}

The set of weightset names.

Definition at line 88 of file context-parser.hh.

Referenced by any_(), and labelset_or_weightset_().

std::set<std::string> vcsn::ast::context_parser::weightsets_
private
Initial value:
=
{
"b",
"f2",
"q",
"qmp",
"r",
"rmin",
"z",
"zmin",
}

The set of terminal weightset names.

Definition at line 74 of file context-parser.hh.

Referenced by any_(), labelset_or_weightset_(), and weightset_().


The documentation for this class was generated from the following files: