2. Building Semantic Analysis
This will be shorter, since most of what I say is better just written in code.
The main idea is two passes:
- Hoist
Bring procedures to the top to allow forward references. I explain why I did so above. - Visit
Acctually go through and validate. This is the main core bit of the semantic analysis portion.
I am a little stuck at a desgin fork. Should I allow scripts inside no ‘Sprite’ Scope to be there? Or should I force them into the Stage. Or do I error?
Scratch-like behaviors tell me that it should go to stage, but that feels tacky and wrong.
- Can functions be public? I think so. Can’t be temp.
- Need to make start and end possibly null
- Make function be able to be public/private. Assumed private
- Everything at the root of a file should be invalidated. The space should be reserved for imports, functions, global stuff.
Overall, I worked on building semantic analysis, at least the basic parts. I added variable decleration handling in scopes, and all of expressionstatement parsing.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.