We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What is your question?
Trying to create a grammar that can parse any YAML file.
If you're having trouble with your code or grammar
Here is the code I am using.
%import common.NEWLINE %import common.ESCAPED_STRING %import common.SIGNED_NUMBER %import common.WS_INLINE %ignore WS_INLINE start: document document: element+ element: mapping | sequence | scalar mapping: mapping_pair+ mapping_pair: key ":" WS_INLINE? value NEWLINE? key: scalar value: scalar | mapping_block | sequence_block mapping_block: NEWLINE INDENT mapping_pair+ DEDENT sequence: sequence_item+ sequence_item: "-" WS_INLINE? value NEWLINE? sequence_block: NEWLINE INDENT sequence_item+ DEDENT scalar: ESCAPED_STRING -> string | SIGNED_NUMBER -> number | BOOL -> boolean | NULL -> null | unquoted_string -> unquoted unquoted_string: /[^{}\[\],":\s\n][^{}\[\],":\n]*/ BOOL: "true" | "false" NULL: "null" | "~" %declare INDENT DEDENT %ignore WS_INLINE
Explain what you're trying to do, and what is obstructing your progress.
I new to CFG and seem to struggle with the INDENT / DEDENTs.
What is going wrong with this and does anyone have a working example on how I could use a CFG to parse a YAML file?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What is your question?
Trying to create a grammar that can parse any YAML file.
If you're having trouble with your code or grammar
Here is the code I am using.
Explain what you're trying to do, and what is obstructing your progress.
I new to CFG and seem to struggle with the INDENT / DEDENTs.
What is going wrong with this and does anyone have a working example on how I could use a CFG to parse a YAML file?
The text was updated successfully, but these errors were encountered: