diff --git a/Language-specifications/typee_specs_LL1-v9-1.grm b/Language-specifications/typee_specs_LL1-v9-1.grm index 439f13b..8bbb760 100644 --- a/Language-specifications/typee_specs_LL1-v9-1.grm +++ b/Language-specifications/typee_specs_LL1-v9-1.grm @@ -584,26 +584,25 @@ SOFTWARE. | EPS ::= -## | EPS #### ::= ',' | EPS ::= 'exclude' '{{' '}}' - ::= '<' #### + ::= '<' | '>' ::= '<<' | '>>' | '>>>' | EPS - ::= '!' #### + ::= '!' ::= '(' ')' | '[' ']' '=' | '>>' | '>>>' | EPS - ::= ',' #### + ::= ',' | EPS ::= 'break' diff --git a/src/FrontEnd/Errors/fe_syntax_errors.py b/src/FrontEnd/Errors/fe_syntax_errors.py index fcde228..bc263bc 100644 --- a/src/FrontEnd/Errors/fe_syntax_errors.py +++ b/src/FrontEnd/Errors/fe_syntax_errors.py @@ -111,17 +111,17 @@ class FESyntaxErrors: EXCLUDE_LANGS = 'missing or badly formed targeted languages list in exclude clause', EXPR_FOR_COMPREHENSION = 'missing keyword for after expression in comprehension clause', - FILE_ENDIAN_EXPR = 'missing or badly formed file identifier or expression after endianness specification', - FILE_FLUSH_APPEND_EXPR = 'missing or badly formed expression to be appended at end while flushing file', - FILE_FLUSH_FUNC_CALL = 'missing or badly form expression in function or method arguments while flushing file', - FILE_FLUSH_FUNC_END = 'missing ) at end of function call while flushing file', - FILE_FLUSH_IDENT = 'missing or badly formed file identifier after flushing operator "!"', - FILE_FLUSH_INDEX = 'missing or badly formed expression in container index while flushing file', - FILE_FLUSH_INDEX_ASSIGN = 'missing = for storage while flushing indexed file,' - FILE_FLUSH_INDEX_END = 'missing ] at end of container index while flushing file', - FILE_FLUSH_INDEX_EXPR = 'missing or badly formed expression to be stored while flushing indexed file', - FILE_FLUSH_STORE_EXPR = 'missing or badly formed expression to be stored while flushing file', - FILE_STREAM_EXPR = 'missing or badly formed identifier or expression in file streaming statement', + FILE_ENDIAN_EXPR = 'missing or badly formed expression after file identifier while specifying endianness', + FILE_FLUSH_APPEND_EXPR = 'missing or badly formed expression in file appending while flushing file', + FILE_FLUSH_FUNC_CALL = 'missing or badly formed arguments of function/method while flushing file', + FILE_FLUSH_FUNC_END = 'missing ) at end of arguments of function/method call while flushing file', + FILE_FLUSH_IDENT = 'missing or badly formed identifier of file while applying flush operator "!"', + FILE_FLUSH_INDEX = 'missing or badly formed expression in index while flushing indexed file', + FILE_FLUSH_INDEX_ASSIGN = 'missing = after container indexing while flushing file', + FILE_FLUSH_INDEX_END = 'missing ] at end of index while flushing indexed file', + FILE_FLUSH_INDEX_EXPR = 'missing or badly formed expression to store while flushing indexed file' + FILE_FLUSH_STREAM_EXPR = 'missing or badly formed expression in file streaming while flushing file', + FILE_STREAM_EXPR = 'missing or badly formed expression in file streaming while specifying endianness', FINAL_DEF = 'missing type identifier after keyword "final"', FOR_BODY = 'missing instruction or block of instructions after for clause in for instruction', FOR_COMPR_CONDITION = 'missing or badly formed condition after keyword "if" in for-comprehension clause', diff --git a/src/FrontEnd/Parser/fe_parser.py b/src/FrontEnd/Parser/fe_parser.py index 27e2955..a4aef66 100644 --- a/src/FrontEnd/Parser/fe_parser.py +++ b/src/FrontEnd/Parser/fe_parser.py @@ -1405,7 +1405,7 @@ def _file_endianness1(self) -> bool: #======================================================================= while self._current.is_SHIFTL() or \ self._current.is_SHIFTR() or \ - self._current.is_SHIFT0L(): + self._current.is_SHIFT0R(): self._append_syntaxic_node() self._next_token_node() if not self._expression(): @@ -1415,12 +1415,12 @@ def _file_endianness1(self) -> bool: #------------------------------------------------------------------------- def file_flushing(self) -> bool: #======================================================================= - # ::= '!' + # ::= '!' #======================================================================= if self._current.is_EXCL(): self._append_syntaxic_node() self._next_token_node() - if not self._expression()(): + if not self._dotted_name(): self._append_error( FESyntaxErrors.FILE_FLUSH_IDENT ) self._file_flushing1(); return True @@ -1468,7 +1468,7 @@ def file_flushing1(self) -> bool: self._append_syntaxic_node() self._next_token_node() if not self._expression(): - self._append_error( FESyntaxErrors.FILE_FLUSH_STORE_EXPR ) + self._append_error( FESyntaxErrors.FILE_FLUSH_STREAM_EXPR ) elif self._current.is_SHIFT0R(): self._append_syntaxic_node() self._next_token_node()