gracelang / minigrace

Self-hosting compiler for the Grace programming language
39 stars 22 forks source link

Add type declarations to GCT and parameterize methodInInterface #300

Closed pavlerohalj closed 5 years ago

pavlerohalj commented 5 years ago

Types in GCT

We have found that methodtypes-of: entry in GCT does not contain sufficient type information. We have added a typedec-of: entry that stores each type declaration in source Grace syntax. Getting a type declaration from such an entry is then straightforward:

def tokens = lex.lexLines(gct.at(key))
def typeDec = parser.typedec(tokens)

Moreover, publicMethod entry was not being added when a node encountered while building GCT was a method node.

Parameterized methodInInterface

We use parameterized methodInInterface to process GCT keys that start with publicMethod. In particular:

def tokens = lex.lexLines(gct.at(key))
def methodType = parser.methodInInterface(tokens)
pavlerohalj commented 5 years ago

Updated golden output for t179_gctTypeInformation