Skip to content

implement expression parser to extend abilities. #168

@Ark2000

Description

@Ark2000
Owner

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @Ark2000

      Issue actions

        implement expression parser to extend abilities. · Issue #168 · Ark2000/PankuConsole