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

new Grammer #4057

Open
appt2 opened this issue Apr 19, 2024 · 3 comments
Open

new Grammer #4057

appt2 opened this issue Apr 19, 2024 · 3 comments
Labels
new-grammar New grammar issue or pull request

Comments

@appt2
Copy link

appt2 commented Apr 19, 2024

hello can you adding yml grammer?

@appt2
Copy link
Author

appt2 commented Apr 19, 2024

grammar YamlGrammar;

yaml: document+;

document: key_value_pairs EOF;

key_value_pairs: key_value_pair
              | key_value_pairs key_value_pair;

key_value_pair: key ':' value;

key: STRING;

value: STRING
     | NUMBER
     | BOOLEAN
     | list
     | key_value_pairs;

list: '[' value (',' value)* ']';

STRING: '"' ~["]* '"';
NUMBER: ('-'? [0-9]+ '.' [0-9]+);
BOOLEAN: ('true' | 'false');

WS: [ \t\r\n]+ -> skip;

COMMENT: '#' ~[\r\n]* -> skip;

@kaby76 I wrote an example and even compiled it with a jar file, it looks good, of course you know better, you can publish it with a little change because I am not a good grammar writer.

@KvanTTT KvanTTT added the new-grammar New grammar issue or pull request label Apr 19, 2024
@KvanTTT
Copy link
Member

KvanTTT commented Apr 19, 2024

Hi! Couldn't you please do it by yourself using a pull request to the repository?

@appt2
Copy link
Author

appt2 commented Apr 19, 2024

Hi! Can't you do it by yourself using a pull request to the repository?

I do it in the evening, I just have to install termux, it takes a few minutes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-grammar New grammar issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants