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

antlr4.yaml: Add g4 language #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions data/Delimiter/antlr_colon_semicolon.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type: block
start: ":"
end: ";"
46 changes: 46 additions & 0 deletions data/Language/antlr4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
identifier: antlr4
creation_date: 2017
wikidata: Q295801
full_name: Another Tool For Language Recognition
grammar_file: https://github.com/antlr/grammars-v4/tree/master/antlr4
aliases:
- antlr4
extensions:
- g4
line_continuation:
- backslash
- vertbar
delimiters:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we have a rule delimiter ; as well. And lines are assumed to continue over any whitespace unless a rule delimiter is encountered.
example rule:

genericAssocList
    :   genericAssociation
    |   genericAssocList ',' genericAssociation
    ;

Although I haven't seen the statement delimiter mentioned in most of the languages, probably a useful thing to include ? (most new languages use a semicolon, but some older ones use newlines / full stops as well)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems practical, will add this too.

# comment delimiters:
- double_slash
- multiline_slash_star
- multiline_double_slash_star
# string delimiters:
- single_quote_slash_escape
# block delimiters:
- curly_braces
- round_braces
- square_braces
- antlr_colon_semicolon
keywords:
- import
- fragment
- lexer
- parser
- grammar
- returns
- locals
- throws
- catch
- finally
- mode
- options
- tokens
- skip
- more
- popMode
# x is a parameter
Dhiraj240 marked this conversation as resolved.
Show resolved Hide resolved
- mode(x)
- pushMode(x)
- type(x)
- channel(x)