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

How about a "Burry" action? #47

Closed
woutersl opened this issue Feb 7, 2018 · 5 comments

Comments

@woutersl
Copy link
Member

commented Feb 7, 2018

Original report by Goomba (Bitbucket: 5a6bdc01c10afd5fcdd933bf, GitHub: raizam).


Hi, first Hime is awesome, it has very sophisticated features, so I think it's worth creating a bitbucket account to post this :)

The promotes and drop actions are great, but it would be nice to turn nodes into childs too.

something like ${ child_statement }$ where the $ symbols would define the parent node, and turn the AST into {} => child_statement.

Not sure I was clear =)

@woutersl

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2018

Original comment by Laurent Wouters (Bitbucket: 557058:675792b6-d731-4823-9f7d-c6dfcb2df2b5, ).


Hi, thanks for the input! I think this is an interesting proposal and would not require much change.
Note that Hime already have a feature for context-sensitive lexing that uses a notation such as:

variable -> x #context { a b c } y ;

As you can see, Hime already uses the curly brackets within the body of rules to delimit a part of this body. So why not re-use this without the context specification. So this would give:

variable -> x { a b c } y ;

The produced AST would be like:

variable( x epsilon( a b c )  y )

Because we still need to put a symbol on the created sub-parent, we could use the built-in epsilon terminal.
I think this can be implemented as a rather simple grammar re-rewriting because the rule would be equivalent to:

variable -> x _gen y ;
_gen -> epsilon^ a b c ;

where _gen is a generated variable that will be replaced when parsing by the epsilon terminal with the promote action.

Do you think this would solve your issue ?

@woutersl

This comment has been minimized.

Copy link
Member Author

commented Feb 18, 2018

Original comment by Laurent Wouters (Bitbucket: 557058:675792b6-d731-4823-9f7d-c6dfcb2df2b5, ).


[fix] Fixed issue #47 Support for sub-rules

2 similar comments
@woutersl

This comment has been minimized.

Copy link
Member Author

commented Feb 18, 2018

Original comment by Laurent Wouters (Bitbucket: 557058:675792b6-d731-4823-9f7d-c6dfcb2df2b5, ).


[fix] Fixed issue #47 Support for sub-rules

@woutersl

This comment has been minimized.

Copy link
Member Author

commented Feb 18, 2018

Original comment by Laurent Wouters (Bitbucket: 557058:675792b6-d731-4823-9f7d-c6dfcb2df2b5, ).


[fix] Fixed issue #47 Support for sub-rules

@woutersl woutersl closed this Feb 18, 2018

@woutersl

This comment has been minimized.

Copy link
Member Author

commented Feb 18, 2018

Original comment by Goomba (Bitbucket: 5a6bdc01c10afd5fcdd933bf, GitHub: raizam).


Very nice job! I'll try it as soon as I can.
Please update the tutorials too =)

thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.