grammars-v4 icon indicating copy to clipboard operation
grammars-v4 copied to clipboard

new Grammer

Open appt2 opened this issue 2 months ago • 3 comments

hello can you adding yml grammer?

appt2 avatar Apr 19 '24 14:04 appt2

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.

appt2 avatar Apr 19 '24 15:04 appt2

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

KvanTTT avatar Apr 19 '24 15:04 KvanTTT

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

appt2 avatar Apr 19 '24 15:04 appt2