Skip to content

Conversation

@sruthin21
Copy link

This PR will resolve #399.

This pull request adds a new utility (blockToAST.ts) that converts the Project Builder’s IBrick objects into a simplified Abstract Syntax Tree (AST). Specifically:

Introduces a ASTNode class (or equivalent) for representing syntax elements.

Implements a convertBrickToAST function that maps each IBrick to an ASTNode, handling different brick types (data, expression, statement, block).

Includes a buildASTFromBricks function for converting multiple top-level bricks (e.g., each code stack) to an array of AST root nodes.

Provides placeholders and comments for handling child bricks, nested statements, and data values.

Adapts to the existing IBrick hierarchy (IBrickData, IBrickExpression, IBrickStatement, IBrickBlock) by casting as needed.

@sruthin21
Copy link
Author

Hey @meganindya, @walterbender, @pikurasa! I’ve just opened a PR that addresses #399 by adding the new block-to-AST conversion utility. Please take a look when you get a chance – I’d love your feedback or any suggestions you may have. Thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project Builder Integration

1 participant