Skip to content
Discussion options

You must be logged in to vote

What I meant by return type was in a programming sense. In the addition example, I can tell that the parser should look for parameters of numbers.

You would need to write a type system yourself. Type systems effectively sit on top of a parsed AST and provide additional information about types of the parsed AST elements. I would recommend you to take a look at our Lox example language repo and especially the type system related code.

The lox language itself is from the crafting interpreters book. I can only recommend to take a look at that if you're completely new to anything compiler related.

I may be thinking about the parser rules in the wrong way. Do let me know what you think.

Pro…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Lemour-sudo
Comment options

@msujew
Comment options

@Lemour-sudo
Comment options

@msujew
Comment options

Answer selected by msujew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants