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

implement expression parser to extend abilities. #168

Open
Ark2000 opened this issue Mar 31, 2024 · 0 comments
Open

implement expression parser to extend abilities. #168

Ark2000 opened this issue Mar 31, 2024 · 0 comments
Assignees
Labels
Critical 💩 Feature✨ New feature or request

Comments

@Ark2000
Copy link
Owner

Ark2000 commented Mar 31, 2024

Approach:

implement a customed parser according to Expression source:

  1. https://github.com/godotengine/godot/blob/master/core/math/expression.cpp.
  2. https://github.com/godotengine/godot/blob/master/tests/core/math/test_expression.h

Basic Steps:

  1. Implement a lexical analyzer to tokenize the input expression string into individual tokens, such as numbers, operators, variable names, etc.
  2. Implement a parser to parse the token sequence into an abstract syntax tree (AST).
  3. Write an interpreter to traverse the AST and evaluate the expression.
  4. Provide support for variable references, function calls, etc.
  5. Implement necessary data structures, such as an operator precedence table, etc.
  6. Consider handling common edge cases and error situations.

Expected benefits:

  1. dynamic intelligent code completion support, instead of simple string matching.
  2. extended assignment expression support, instead of set method. Set non exported values #167

A customed parser will make panku console truely unique, powerful and irreplaceable.

@Ark2000 Ark2000 added Critical 💩 Feature✨ New feature or request labels Mar 31, 2024
@Ark2000 Ark2000 self-assigned this Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical 💩 Feature✨ New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant