Skip to content

Commit

Permalink
#150 - Correct/Modify Parser Code
Browse files Browse the repository at this point in the history
Modified Parser code according to last modification to version v10 of __Typee__ grammar sepcs.
  • Loading branch information
schmouk committed Aug 28, 2019
1 parent d9eab33 commit 538540d
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions src/FrontEnd/Parser/fe_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ def _atom_element1(self) -> bool:
#-------------------------------------------------------------------------
def _atom_element2(self) -> bool:
#=======================================================================
# <atom element''> ::= <scalar type> <scalar type casting>
# <atom element''> ::= <scalar type'> <scalar type casting>
#=======================================================================
if self._scalar_type():
if self._scalar_type1():
if not self._type_casting():
self._append_error( FESyntaxErrors.CASTING_PAROP )
return True
Expand Down Expand Up @@ -1935,6 +1935,21 @@ def _fwd_var_decl(self) -> bool:
self._append_error( FESyntaxErrors.FORWARD_VARS_LIST )
return True

#-------------------------------------------------------------------------
def _generic_scalar_type(self) -> bool:
#=======================================================================
# <generic scalar type> ::= '_float_'
# | '_int_'
# | '_numeric_'
# | '_uint_'
#=======================================================================
if self._current.is_GENRIC_SCALAR_TYPE(): ## (notice: previously scanned by Front-End Scanner)
self._append_syntaxic_node()
self._next_token_node()
return True
else:
return False

#-------------------------------------------------------------------------
def _identifier(self) -> bool:
#=======================================================================
Expand Down Expand Up @@ -2909,7 +2924,14 @@ def _scalar(self) -> bool:
#-------------------------------------------------------------------------
def _scalar_type(self) -> bool:
#=======================================================================
# <scalar type> ::= "bool"
# <scalar type> ::= <scalar type'> | <generic scalar type>
#=======================================================================
return self._scalar_type1() or self._generic_scalar_type()

#-------------------------------------------------------------------------
def _scalar_type1(self) -> bool:
#=======================================================================
# <scalar type'> ::= "bool"
# | "char"
# | "char16"
# | "float32"
Expand Down

0 comments on commit 538540d

Please sign in to comment.