Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

Add a symbol table #72

Open
jrmuizel opened this issue Jul 30, 2019 · 5 comments
Open

Add a symbol table #72

jrmuizel opened this issue Jul 30, 2019 · 5 comments

Comments

@jrmuizel
Copy link
Contributor

This is needed to do semantic analysis and translation to spirv.

Do you have any thoughts on how you'd like to represent it?

glslang builds the symbol table during parsing and refers to it in the resulting parse tree. That has the advantage of not needing to represent both an unresolved syntax tree and a syntax tree with resolved symbols.

@hadronized
Copy link
Owner

Hm, I need to have more information / find more material about that symbole table they’re using. Do you have any link?

@jrmuizel
Copy link
Contributor Author

Alternatively, the mesa glsl compiler parses to a low level AST and then lifts to a HIR:
https://github.com/mesa3d/mesa/blob/4bf7e7b17092487b6b6c4aff5e920dbe1fd4470e/src/compiler/glsl/README

@jrmuizel
Copy link
Contributor Author

I'm experimenting with HIR approach here: https://github.com/jrmuizel/glsl-to-spriv

@hadronized
Copy link
Owner

@jrmuizel great! I haven’t had enough spare time lately to look into that, but feel free to go for it! I’ll have a look at the code you wrote, I’m interested in the approach. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants