Difference between revisions of "Syntax checking/Parser"
(→EIFFEL_PARSER) |
|||
Line 9: | Line 9: | ||
* inherits from EIFFEL_PARSER_SKELETON (where the features parse, parse_string, make_with_factory are implemented) | * inherits from EIFFEL_PARSER_SKELETON (where the features parse, parse_string, make_with_factory are implemented) | ||
* make_with_factory (a_factory: AST_FACTORY): give argument of type AST_NULL_FACTORY (inherits from AST_FACTORY) | * make_with_factory (a_factory: AST_FACTORY): give argument of type AST_NULL_FACTORY (inherits from AST_FACTORY) | ||
− | * parse (a_file: KL_BINARY_INPUT_FILE) and parse_from_string (a_string: STRING) | + | ** AST_NULL_FACTORY doesn't build an AST (AST_FACTORY does, the AST is in EIFFEL_PARSER.root_node after parsing) |
+ | * parse (a_file: KL_BINARY_INPUT_FILE) and parse_from_string (a_string: STRING). | ||
+ | |||
====CLASS_AS==== | ====CLASS_AS==== | ||
* AST of a class | * AST of a class |
Revision as of 12:43, 5 June 2006
Important Classes/Files
eiffel.y
- Eiffel grammar description.
- use geyacc to generate eiffel_parser.e from this file
EIFFEL_PARSER
- inherits from EIFFEL_PARSER_SKELETON (where the features parse, parse_string, make_with_factory are implemented)
- make_with_factory (a_factory: AST_FACTORY): give argument of type AST_NULL_FACTORY (inherits from AST_FACTORY)
- AST_NULL_FACTORY doesn't build an AST (AST_FACTORY does, the AST is in EIFFEL_PARSER.root_node after parsing)
- parse (a_file: KL_BINARY_INPUT_FILE) and parse_from_string (a_string: STRING).
CLASS_AS
- AST of a class
ERROR
- deferred; superclass of all error types like EIFFEL_ERROR or SYNTAX_ERROR
- features line, column: INTEGER give location of error
ERROR_HANDLER
- feature error_list: ERROR is a list of errors found by the parser
SHARED_ERROR_HANDLER
- singleton used by all relevant classes
EIFFEL_CLASS_C
- features build_ast and parse_ast show how the parser can be used.
Implementation
- based on Paul's code
ERROR classes
- Create new SYNTAX_ERROR classes that correspond to Paul's classes, but fit into the current hierarchy
- store start and end position of the error
extend parser to generate the right ERRORs
- Integrate Paul's changes to eiffel.l and eiffel.y into the current versions.
- add facilities from Paul's EIFFEL_PARSER_ERROR_REPORTER
- in existing class like EIFFEL_PARSER_SKELETON (EP_ERROR_REPORTER only inherits SHARED_ERROR_HANDLER and so does EP_SKELETON
- in new class
Work distributiony
eiffel.y
- Ueli: 0 - 844: Parent_List
- Marko: 845 - 1494 Formal Generics
- Michi: 1495 - 2130 Instruction Call
- Martin: 2131 - end
error classes
- Chrigu
classes with errors to check if parser works
- nobody yet