|
LRDE Tiger Compiler
1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
|
Parsing the input, delivering an ast::Ast. More...
Namespaces | |
| namespace | tasks |
| Tasks of the parse module. | |
Classes | |
| class | MetavarMap |
| A generic map of metavariables. More... | |
| class | TigerParser |
| Conduct the scanner and the parser. More... | |
| class | Tweast |
| TWEAST stands for ``Text With Embedded Abstract Syntax Trees''. More... | |
Typedefs | |
| typedef misc::variant < ast::Exp *, ast::DecsList * > | ast_type |
| Result of a parse: an Exp (*.tig) or a DecsList (*.tih). | |
Functions | |
| std::pair< ast::DecsList *, misc::error > | parse (const std::string &prelude, const std::string &fname, misc::file_library &l, bool scan_trace_p, bool parse_trace_p, bool enable_object_extensions_p=false) |
| Parse a Tiger file, return the corresponding abstract syntax tree. | |
| ast_type | parse (Tweast &input) |
| Parse a Tweast. | |
| ast::Exp * | parse (const std::string &str, bool enable_object_extensions_p=false) |
| Parse a std::string. Used for unit tests. | |
| ast::DecsList * | parse_unit (const std::string &str, bool enable_object_extensions_p) |
| ast::Decs * | parse_decs (Tweast &in) |
| Parse a set of declarations. | |
| std::ostream & | operator<< (std::ostream &ostr, const Tweast &in) |
| Display the content of the tweast. | |
Parsing the input, delivering an ast::Ast.
| typedef misc::variant<ast::Exp*, ast::DecsList*> parse::ast_type |
Result of a parse: an Exp (*.tig) or a DecsList (*.tih).
| std::ostream & parse::operator<< | ( | std::ostream & | ostr, |
| const Tweast & | in | ||
| ) |
Display the content of the tweast.
References parse::Tweast::dump().
| std::pair< ast::DecsList *, misc::error > parse::parse | ( | const std::string & | prelude, |
| const std::string & | fname, | ||
| misc::file_library & | l, | ||
| bool | scan_trace_p, | ||
| bool | parse_trace_p, | ||
| bool | enable_object_extensions_p = false |
||
| ) |
Parse a Tiger file, return the corresponding abstract syntax tree.
| prelude | name of the prelude file. |
| fname | path and name of the tiger file. |
| file_library | library for managing search path. |
| scan_trace_p | display informations on scan step. |
| parse_trace_p | display informations on parse step. |
| enable_object_extensions_p | enable object constructions |
References misc::basedir(), parse::TigerParser::enable_object_extensions(), parse::TigerParser::error_get(), misc::make_pair(), parse::TigerParser::parse(), parse::TigerParser::parse_file(), parse::TigerParser::parse_import(), parse::TigerParser::parse_trace(), misc::file_library::pop_current_directory(), parse::TigerParser::prelude(), misc::file_library::push_current_directory(), and parse::TigerParser::scan_trace().
Referenced by object::DesugarVisitor::adapt_type(), object::DesugarVisitor::dispatch_switch(), object::DesugarVisitor::operator()(), parse_decs(), and object::DesugarVisitor::variant_exp().
| ast_type parse::parse | ( | Tweast & | input | ) |
Parse a Tweast.
Extensions are enabled. Raises an exception on errors.
References parse::TigerParser::enable_extensions(), parse::TigerParser::enable_object_extensions(), parse::TigerParser::error_get(), and parse::TigerParser::parse().
| ast::Exp * parse::parse | ( | const std::string & | str, |
| bool | enable_object_extensions_p | ||
| ) |
Parse a std::string. Used for unit tests.
References parse::TigerParser::enable_object_extensions(), parse::TigerParser::error_get(), and parse::TigerParser::parse().
| ast::Decs * parse::parse_decs | ( | Tweast & | in | ) |
Parse a set of declarations.
Wrapper around parse::parse to return the single ast::Decs to be found in the input (expected to contain decs_listdecs).
Used by desugar::BoundCheckingVisitor and object::ObjectDesugarVisitor.
References assertion, ast::DecsList::decs_get(), and parse().
| ast::DecsList * parse::parse_unit | ( | const std::string & | str, |
| bool | enable_object_extensions_p = false |
||
| ) |
Parse a std::string. Used for unit tests. The declaration of the _main function is automatically added.
References parse::TigerParser::enable_object_extensions(), parse::TigerParser::error_get(), and parse::TigerParser::parse().