/* Objective Modula-2 Compiler (objm2c) * * objm2_production_table.h * EBNF production master table * * Author: Benjamin Kowarsch * * Copyright (C) 2009 The Objective Modula-2 Project. All rights reserved. * * License: * * Permission is hereby granted to review and test this software for the sole * purpose of supporting the effort by the licensor to define and develop the * Objective Modula-2 language. It is not permissible under any circumstances * to use the software for the purpose of creating derivative languages or * dialects. This permission is valid until 31 December 2009, 24:00h GMT. * * Future licensing: * * The licensor undertakes to eventually release this software under a proper * open source license AFTER the Objective Modula-2 language definition has * been finalised and a conforming and working reference compiler completed. * * Version history: * * 2.00 2009-08-31 BK new file * 2009-09-20 BK added FIRST and FOLLOW set data */ // This file represents the EBNF PRODUCTION MASTER TABLE for the ObjM2 // compiler, used to generate data structures containing productions and their // FIRST and FOLLOW sets, thereby keeping those structures in synchronisation. // Consequently, any changes, additions or removals of productions and their // respective FIRST and FOLLOW sets must be made in this file, not anywhere // else. Failing to do so will result in an incorrect compiler as related // data structures will no longer be synchronised. // // NB: The FIRST and FOLLOW set data in this file has been automatically // generated using the utility gen_first_and_follow_sets.c // // // How to use this master table: // // The following code will generate a declaration for an enumeration of // all productions prefixed with p_ ... // // #define _add_production(_production, \ // _first0, _first1, _first2, _first3, \ // _follow0, _follow1, _follow2, _follow3 ) p_ ## _production, // // typedef enum objm2_production_t { // #include "objm2_production_table.h" // OBJM2_NUMBER_OF_PRODUCTIONS // } /* objm2_production_t */; // #undef _add_production // // // The following code will generate an array of tokensets initialised with the // FIRST sets of all productions ... // // #define _add_production(_production, \ // _first0, _first1, _first2, _first3, \ // _follow0, _follow1, _follow2, _follow3 ) \ // { _first0, _first1, _first2, _first3 }, // // objm2_tokenset_a FIRST[] = { // #include "objm2_production_table.h" // { 0, 0, 0, 0 } // } /* FIRST */; // #undef _add_production // // // The following code will generate an array of tokensets initialised with the // FOLLOW sets of all productions ... // // #define _add_production(_production, \ // _first0, _first1, _first2, _first3, \ // _follow0, _follow1, _follow2, _follow3 ) \ // { _follow0, _follow1, _follow2, _follow3 }, // // objm2_tokenset_a FOLLOW[] = { // #include "objm2_production_table.h" // { 0, 0, 0, 0 } // } /* FOLLOW */; // #undef _add_production // // // Arguments for the _add_production macro: // // 1st: production name, must be preceeded by an underscore // // 2nd: 32-bit unsigned integer representing bits 0 to 31 of FIRST set // 3rd: 32-bit unsigned integer representing bits 32 to 63 of FIRST set // 4th: 32-bit unsigned integer representing bits 64 to 95 of FIRST set // 5th: 32-bit unsigned integer representing bits 96 to 127 of FIRST set // // 6th: 32-bit unsigned integer representing bits 0 to 31 of FOLLOW set // 7th: 32-bit unsigned integer representing bits 32 to 63 of FOLLOW set // 8th: 32-bit unsigned integer representing bits 64 to 95 of FOLLOW set // 9th: 32-bit unsigned integer representing bits 96 to 127 of FOLLOW set // Productions _add_production( _compilation_unit, 0xC4000000, 0x64000000, 0xCC000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000001, 0x00000000 ) // FOLLOW set _add_production( _program_module, 0xEC000000, 0xFC000000, 0x02000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000001, 0x00000000 ) // FOLLOW set _add_production( _definition_of_module, 0x22000000, 0xA2000000, 0x62000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000001, 0x00000000 ) // FOLLOW set _add_production( _implementation_of_module, 0x12000000, 0x92000000, 0x52000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000001, 0x00000000 ) // FOLLOW set _add_production( _protocol, 0x32000000, 0xB2000000, 0x72000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000001, 0x00000000 ) // FOLLOW set _add_production( _import_list, 0x0A000000, 0x8A000000, 0x4A000000, 0x00000000, // FIRST set 0x10404002, 0x04200280, 0x00000000, 0x00000000 ) // FOLLOW set _add_production( _declaration, 0x2A000000, 0x9A000000, 0xDA000000, 0x00000000, // FIRST set 0x10004000, 0x00000000, 0x00000000, 0x00000000 ) // FOLLOW set _add_production( _definition, 0x00C00002, 0x00200280, 0x00000000, 0x00000000, // FIRST set 0x00004000, 0x00000000, 0x00000000, 0x00000000 ) // FOLLOW set _add_production( _const_declaration, 0x00000000, 0x00000010, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _type_declaration, 0x00000000, 0x00000010, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _type, 0x20802000, 0x00A24010, 0x00004000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _anonymous_type, 0x20000000, 0x00A20000, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _enumeration_type, 0x00002000, 0x00000000, 0x00004000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _array_type, 0x20000000, 0x00000000, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _record_type, 0x00000000, 0x00020000, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _field_list_sequence, 0x00000000, 0x00000010, 0x00000000, 0x00000000, // FIRST set 0x00004000, 0x00000000, 0x00000000, 0x00000000 ) // FOLLOW set _add_production( _field_list, 0x00000000, 0x00000010, 0x00000000, 0x00000000, // FIRST set 0x00004000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _class_type, 0x00800000, 0x00000000, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _set_type, 0x00000000, 0x00004000, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _pointer_type, 0x00000000, 0x00800000, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _procedure_type, 0x00000000, 0x00200000, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _formal_type_list, 0x20000100, 0x00000090, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000030, 0x00000000 ) // FOLLOW set _add_production( _attributed_formal_type, 0x20000100, 0x00000090, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000070, 0x00000000 ) // FOLLOW set _add_production( _formal_type, 0x20000000, 0x00000010, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000070, 0x00000000 ) // FOLLOW set _add_production( _variable_declaration, 0x00000000, 0x00000010, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _procedure_declaration, 0x00000000, 0x00200000, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _procedure_header, 0x00000000, 0x00200000, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _formal_param_list, 0x00000100, 0x00000090, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00002000, 0x00000000 ) // FOLLOW set _add_production( _formal_params, 0x00000100, 0x00000090, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000040, 0x00002010, 0x00000000 ) // FOLLOW set _add_production( _method_declaration, 0x00800002, 0x00000000, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _method_header, 0x00800002, 0x00000000, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000010, 0x00000000 ) // FOLLOW set _add_production( _method_arg, 0x00000000, 0x00000008, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000030, 0x00000000 ) // FOLLOW set _add_production( _statement, 0x01101A04, 0x00018430, 0x00001000, 0x00000000, // FIRST set 0x00214000, 0x10000100, 0x00000018, 0x00000000 ) // FOLLOW set _add_production( _statement_sequence, 0x01101A04, 0x00018430, 0x00001000, 0x00000000, // FIRST set 0x0021C000, 0x10000100, 0x00000008, 0x00000000 ) // FOLLOW set _add_production( _method_invocation, 0x00000000, 0x00000000, 0x00001000, 0x00000000, // FIRST set 0x00214000, 0x10000118, 0x00000018, 0x00000000 ) // FOLLOW set _add_production( _receiver, 0x00000000, 0x00000010, 0x00001000, 0x00000000, // FIRST set 0x00000000, 0x00000018, 0x00000000, 0x00000000 ) // FOLLOW set _add_production( _message, 0x00000000, 0x00000018, 0x00000000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000800, 0x00000000 ) // FOLLOW set _add_production( _assignment_or_procedure_call, 0x00000000, 0x00000010, 0x00000000, 0x00000000, // FIRST set 0x00214000, 0x10000100, 0x00000018, 0x00000000 ) // FOLLOW set _add_production( _if_statement, 0x00000200, 0x00000000, 0x00000000, 0x00000000, // FIRST set 0x00214000, 0x10000100, 0x00000018, 0x00000000 ) // FOLLOW set _add_production( _case_statement, 0x01000000, 0x00000000, 0x00000000, 0x00000000, // FIRST set 0x00214000, 0x10000100, 0x00000018, 0x00000000 ) // FOLLOW set _add_production( _case, 0x00000000, 0x40000016, 0x10284000, 0x00000000, // FIRST set 0x00014000, 0x00000000, 0x00000008, 0x00000000 ) // FOLLOW set _add_production( _case_label_list, 0x00000000, 0x40000016, 0x10284000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000020, 0x00000000 ) // FOLLOW set _add_production( _case_labels, 0x00000000, 0x40000016, 0x10284000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000060, 0x00000000 ) // FOLLOW set _add_production( _while_statement, 0x00000000, 0x00000020, 0x00000000, 0x00000000, // FIRST set 0x00214000, 0x10000100, 0x00000018, 0x00000000 ) // FOLLOW set _add_production( _repeat_statement, 0x00000000, 0x00010000, 0x00000000, 0x00000000, // FIRST set 0x00214000, 0x10000100, 0x00000018, 0x00000000 ) // FOLLOW set _add_production( _loop_statement, 0x00000004, 0x00000000, 0x00000000, 0x00000000, // FIRST set 0x00214000, 0x10000100, 0x00000018, 0x00000000 ) // FOLLOW set _add_production( _for_statement, 0x00000800, 0x00000000, 0x00000000, 0x00000000, // FIRST set 0x00214000, 0x10000100, 0x00000018, 0x00000000 ) // FOLLOW set _add_production( _try_statement, 0x00000000, 0x00000400, 0x00000000, 0x00000000, // FIRST set 0x00214000, 0x10000100, 0x00000018, 0x00000000 ) // FOLLOW set _add_production( _critical_statement, 0x00100000, 0x00000000, 0x00000000, 0x00000000, // FIRST set 0x00214000, 0x10000100, 0x00000018, 0x00000000 ) // FOLLOW set _add_production( _const_expression, 0x00000000, 0x40000016, 0x10284000, 0x00000000, // FIRST set 0x08020000, 0x20000000, 0x00002EF0, 0x00000000 ) // FOLLOW set _add_production( _relation, 0x00000028, 0x00000000, 0x0FC00000, 0x00000000, // FIRST set 0x00000000, 0x40000016, 0x10284000, 0x00000000 ) // FOLLOW set _add_production( _simple_const_expr, 0x00000000, 0x40000016, 0x10284000, 0x00000000, // FIRST set 0x00000028, 0x00000000, 0x8FC00000, 0x00000000 ) // FOLLOW set _add_production( _add_operator, 0x00000000, 0x02000000, 0x00280000, 0x00000000, // FIRST set 0x00000000, 0x40000016, 0x10004000, 0x00000000 ) // FOLLOW set _add_production( _const_term, 0x00000000, 0x40000016, 0x10004000, 0x00000000, // FIRST set 0x00000028, 0x02000000, 0x8FE80000, 0x00000000 ) // FOLLOW set _add_production( _mul_operator, 0x40040001, 0x00000000, 0x20030000, 0x00000000, // FIRST set 0x00000000, 0x40000016, 0x10004000, 0x00000000 ) // FOLLOW set _add_production( _const_factor, 0x00000000, 0x40000016, 0x10004000, 0x00000000, // FIRST set 0x40040029, 0x02000000, 0xAFEB0000, 0x00000000 ) // FOLLOW set _add_production( _designator, 0x00000000, 0x00000010, 0x00000000, 0x00000000, // FIRST set 0x00004000, 0x00000001, 0x00144010, 0x00000000 ) // FOLLOW set _add_production( _designator_tail, 0x00000000, 0x00000000, 0x00009000, 0x00000000, // FIRST set 0x00004000, 0x00000001, 0x00144010, 0x00000000 ) // FOLLOW set _add_production( _expression_list, 0x00000000, 0x40000016, 0x10285000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00002800, 0x00000000 ) // FOLLOW set _add_production( _expression, 0x00000000, 0x40000016, 0x10285000, 0x00000000, // FIRST set 0x0023C000, 0x30001900, 0x00002858, 0x00000000 ) // FOLLOW set _add_production( _simple_expression, 0x00000000, 0x40000016, 0x10285000, 0x00000000, // FIRST set 0x0023C000, 0x70001916, 0x90282858, 0x00000000 ) // FOLLOW set _add_production( _term, 0x00000000, 0x40000016, 0x10005000, 0x00000000, // FIRST set 0x0023C000, 0x72001916, 0x90282858, 0x00000000 ) // FOLLOW set _add_production( _factor, 0x00000000, 0x40000016, 0x10005000, 0x00000000, // FIRST set 0x0023C000, 0x72001916, 0x90282858, 0x00000000 ) // FOLLOW set _add_production( _designator_or_procedure_call, 0x00000000, 0x00000010, 0x00000000, 0x00000000, // FIRST set 0x0023C000, 0x72001916, 0x90282858, 0x00000000 ) // FOLLOW set _add_production( _actual_parameters, 0x00000000, 0x00000000, 0x00004000, 0x00000000, // FIRST set 0x0023C000, 0x72001916, 0x90282858, 0x00000000 ) // FOLLOW set _add_production( _structured_value, 0x00000000, 0x00000000, 0x00000400, 0x00000000, // FIRST set 0x00214000, 0x10000100, 0x00000258, 0x00000000 ) // FOLLOW set _add_production( _value_component, 0x00000000, 0x40000016, 0x10284000, 0x00000000, // FIRST set 0x00000000, 0x00000000, 0x00000240, 0x00000000 ) // FOLLOW set _add_production( _qualident, 0x00000000, 0x00000010, 0x00000000, 0x00000000, // FIRST set 0x4027C029, 0x32001901, 0xAFFFF858, 0x00000000 ) // FOLLOW set _add_production( _ident_list, 0x00000000, 0x00000010, 0x00000000, 0x00000000, // FIRST set 0x00004000, 0x00000000, 0x00002030, 0x00000000 ) // FOLLOW set // END OF FILE