reference type added and very basic pass by reference works in CGenerator. Much more work to go to make sure complicated cases work and return by reference

This commit is contained in:
Nathan Braswell
2015-07-14 19:32:54 -04:00
parent 8c490908d4
commit 602810002b
8 changed files with 106 additions and 22 deletions

View File

@@ -2,7 +2,8 @@ Goal = translation_unit ;
translation_unit = WS unorderd_list_part WS ;
unorderd_list_part = import WS unorderd_list_part | function WS unorderd_list_part | type_def line_end WS unorderd_list_part | if_comp WS unorderd_list_part | simple_passthrough WS unorderd_list_part | declaration_statement line_end WS unorderd_list_part | import | function | type_def line_end | if_comp | simple_passthrough | declaration_statement line_end ;
type = "\*" WS type | "void" | "int" | "float" | "double" | "char" | scoped_identifier | scoped_identifier WS template_inst | function_type ;
type = "ref" WS pre_reffed | pre_reffed ;
pre_reffed = "\*" WS pre_reffed | "void" | "int" | "float" | "double" | "char" | scoped_identifier | scoped_identifier WS template_inst | function_type ;
function_type = "fun" WS "\(" WS opt_type_list WS "\)" WS ":" WS type ;
dec_type = ":" WS type ;