Skip to content

Add Brick-to-AST Conversion Utility for Project Builder #432

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

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