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

Antlr fixes #15

Open
wants to merge 4 commits 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
24 changes: 9 additions & 15 deletions mts-asn1-antlr/src/main/antlr4/com/ericsson/mts/asn1/ASN1Lexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,6 @@ ENCODED_LITERAL
: 'ENCODED'
;

COMMENT
: '--'
;

PRINTABLE_STRING
: 'PrintableString'
;
Expand All @@ -391,10 +387,6 @@ UNRESTRICTEDCHARACTERSTRINGTYPE
: CHARACTER_LITERAL STRING_LITERAL
;

EXTENSTIONENDMARKER
: COMMA ELLIPSIS
;

fragment DIGIT
: '0'..'9'
;
Expand All @@ -416,11 +408,15 @@ WS
;

Exponent
: ('e'|'E') ('+'|'-')? NUMBER
: ('e'|'E') ('+'|'-') NUMBER
;

LINE_COMMENT
: '--' ~('\n'|'\r')* '\r'? '\n' ->skip
: '--' (.*? ('--'|'\r'? '\n')) ->skip
;

BLOCK_COMMENT
: '/*' (BLOCK_COMMENT | .)*? '*/' ->skip
;

BSTRING
Expand Down Expand Up @@ -494,11 +490,9 @@ JavaIDDigit
;


//OBJECTCLASSREFERENCE
// : UPPER (UPPER | LOWER | '-')
// ;

// String beginning with LETTER and ending with LETTER or DIGIT or UNDERSCORE.
// It can contain LETTER, DIGIT, MINUS and UNDERSCORE but not COMMENT (--)
IDENTIFIER
: LETTER(LETTER|DIGIT|MINUS|UNDERSCORE)*
: LETTER(MINUS (LETTER|DIGIT|UNDERSCORE) | (LETTER|DIGIT|UNDERSCORE))*
;

Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ optionalExtensionMarker : ( COMMA ELLIPSIS )?
;

componentTypeLists :
rootComponentTypeList (COMMA extensionAndException extensionAdditions (optionalExtensionMarker|(EXTENSTIONENDMARKER COMMA rootComponentTypeList)))?
rootComponentTypeList (COMMA extensionAndException extensionAdditions (optionalExtensionMarker|(COMMA ELLIPSIS COMMA rootComponentTypeList)))?
// | rootComponentTypeList COMMA extensionAndException extensionAdditions optionalExtensionMarker
// | rootComponentTypeList COMMA extensionAndException extensionAdditions EXTENSTIONENDMARKER COMMA rootComponentTypeList
| extensionAndException extensionAdditions (optionalExtensionMarker | (EXTENSTIONENDMARKER COMMA rootComponentTypeList))
// | rootComponentTypeList COMMA extensionAndException extensionAdditions COMMA ELLIPSIS COMMA rootComponentTypeList
| extensionAndException extensionAdditions (optionalExtensionMarker | (COMMA ELLIPSIS COMMA rootComponentTypeList))
// | extensionAndException extensionAdditions optionalExtensionMarker
;
rootComponentTypeList : componentTypeList
Expand Down Expand Up @@ -411,7 +411,7 @@ contentsConstraint :
;

componentPresenceLists:
componentPresenceList? (EXTENSTIONENDMARKER (COMMA componentPresenceList)?)?
componentPresenceList? (COMMA ELLIPSIS (COMMA componentPresenceList)?)?
| ELLIPSIS (COMMA componentPresenceList)?
;

Expand Down