TC-1 Improvements

Possible improvements include:

configure.ac

Customize your compiler’s version and group’s name in the AC_INIT macro at the start of the configure.ac.

Handling object-related constructs

Your scanner and parser are not required to support OO constructs, but you are encouraged to do so because it will be the basis for later interesting object bonuses.

Object-related productions from the Syntactic Specifications:

exp =
  (* Object creation. *)
  "new" type-id

  (* Method call. *)
  | lvalue "." id "(" [ exp { "," exp }] ")"
  ;


(* Class definition (alternative form). *)
tydec = "class" id [ "extends" type-id ] "{" classfields "}" ;

(* Class definition (canonical form). *)
ty = "class" [ "extends" type-id ] "{" classfields "}" ;

(* Class fields. *)
classfields = { classfield } ;
classfield =
  (* Attribute declaration (varchunk). *)
    vardec
  (* Method declaration (methchunk). *)
  | { "method" id "(" tyfields ")" [ ":" type-id ] "=" exp }
  ;

Be carefull, you should only allow OO constructs when object extensions is enabled (-o | --object).