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

Questions #1

Closed
mationai opened this issue May 3, 2019 · 4 comments
Closed

Questions #1

mationai opened this issue May 3, 2019 · 4 comments

Comments

@mationai
Copy link

mationai commented May 3, 2019

What is .beef? Googling didn't help...

@pouya-eghbali
Copy link
Owner

Hello, it's a custom language designed for beef. It's a very simple, and limited language for describing language grammars (in bean format). Each line contains one rule, each rule must have 3 parts: left, right and name:

left right => name

left and right should be name (or names) of the rules | tokens to match, for example:

number|string add => addition_start

will expect a (number or string) on left side, and a add token on right side, if matched it will pack them in a token named addition_start.

Optionally each rule can have a meta attribute, this is used to manipulate the parse tree, for example:

number|string add => addition_start {type: left.type, lhs: left}

I made beef because I didn't want to manually make bean token | rule objects.

@mationai mationai changed the title What is .beef Questions May 4, 2019
@mationai
Copy link
Author

mationai commented May 4, 2019

So running node parser.js produces the parse tree of test.clio. How do you verify it's correct?

@pouya-eghbali
Copy link
Owner

We don't have any tests for now, but soon I'll add.

@pouya-eghbali
Copy link
Owner

I've made a csv parser using bean, the grammar file is located here:

https://github.com/pouya-eghbali/ncsv/blob/master/ncsv.beef

you can use the vscode extension to highlight it.

This issue was closed.
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

No branches or pull requests

2 participants