Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reflection #152

Closed
ryangjchandler opened this issue Dec 4, 2022 · 3 comments
Closed

Reflection #152

ryangjchandler opened this issue Dec 4, 2022 · 3 comments
Labels

Comments

@ryangjchandler
Copy link
Collaborator

Something I've experimented with a little bit is a reflection API provided by the parser.

You provide it a generated AST (or multiple ASTs) and the struct is able to traverse the AST to search for function declarations, classes, etc.

You would then be able to call methods on the struct to find a particular class, function, get type information, params etc.

This would do a lot of heavy lifting for static analysis tools, dead code finders, interpreters etc.

@azjezz
Copy link
Collaborator

azjezz commented Dec 4, 2022

reflection can be a whole different project in it's own repository.

it is possible to build a reflection system from AST, see https://github.com/Roave/BetterReflection for reference.

@ryangjchandler
Copy link
Collaborator Author

yeah, whether its part of this repo or not, doesn't bother me. just noting down ideas surrounding the parser

@ryangjchandler
Copy link
Collaborator Author

Not related to parser, closing.

@ryangjchandler ryangjchandler closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants