diff --git a/Language-specifications/typee_specs_LL1-v9-1.grm b/Language-specifications/typee_specs_LL1-v9-1.grm index c807deb..0bf5844 100644 --- a/Language-specifications/typee_specs_LL1-v9-1.grm +++ b/Language-specifications/typee_specs_LL1-v9-1.grm @@ -459,8 +459,8 @@ SOFTWARE. ::= | | - | ## - | ## + | + | | | | @@ -541,7 +541,7 @@ SOFTWARE. | | ::= - | ## + | | ::= | @@ -579,10 +579,10 @@ SOFTWARE. ::= ',' | EPS - ::= '{' '}' ## + ::= '{' '}' - ::= ## - ::= '=' ## + ::= + ::= '=' | EPS ::= diff --git a/src/FrontEnd/Parser/fe_parser.py b/src/FrontEnd/Parser/fe_parser.py index a4aef66..4fb76ba 100644 --- a/src/FrontEnd/Parser/fe_parser.py +++ b/src/FrontEnd/Parser/fe_parser.py @@ -868,6 +868,7 @@ def _decl_or_def_statement1(self) -> bool: ### def _decl_or_def_statement2(self) -> bool: ### #======================================================================= # ::= + # | # | #======================================================================= if self._TYPE1(): @@ -878,6 +879,8 @@ def _decl_or_def_statement2(self) -> bool: ### if not self._decl_constructor_or_decl_end(): self._append_error( FESyntaxErrors.DECL_DEF_TYPE ) return True + elif self._enum_definition(): + return True else: self._append_error( FESyntaxErrors.VAR_TYPE ) return False @@ -1206,7 +1209,7 @@ def _enum_definition(self) -> bool: if self._current.is_ENUM(): self._append_syntaxic_node() self._next_token_node() - if self._current.is_IDENT: + if self._current.is_IDENT(): self._append_syntaxic_node() self._next_token_node() else: @@ -1216,12 +1219,9 @@ def _enum_definition(self) -> bool: self._next_token_node() else: self._append_error( FESyntaxErrors.ENUM_BRACKET_OP ) - if self._enum_list(): - self._append_syntaxic_node() - self._next_token_node() - else: + if not self._enum_list(): self._append_error( FESyntaxErrors.ENUM_LIST ) - if self._current.is_BRACKETCL: + if self._current.is_BRACKETCL(): self._append_syntaxic_node() self._next_token_node() else: @@ -1413,7 +1413,7 @@ def _file_endianness1(self) -> bool: return True #------------------------------------------------------------------------- - def file_flushing(self) -> bool: + def _file_flushing(self) -> bool: #======================================================================= # ::= '!' #======================================================================= @@ -1428,7 +1428,7 @@ def file_flushing(self) -> bool: return False #------------------------------------------------------------------------- - def file_flushing1(self) -> bool: + def _file_flushing1(self) -> bool: #======================================================================= # ::= '(' ')' # | '[' ']' '=' @@ -2935,6 +2935,8 @@ def _simple_statement(self) -> bool: ### # ::= # | # | + # | + # | # | # | # | @@ -2945,6 +2947,8 @@ def _simple_statement(self) -> bool: ### if self._assert_statement() or \ self._del_statement() or \ self._ensure_statement() or \ + self._file_endianness() or \ + self._file_flushing() or \ self._flow_statement() or \ self._import_statement() or \ self._nop_statement() or \ @@ -4139,5 +4143,3 @@ def _next_token_node(self) -> FEICodeTokenNode: return self._current #===== end of FrontEnd.Parser.parser =====# - - \ No newline at end of file