Skip to content

Commit

Permalink
Regenerate UCUM and FHIRPath lexers/parsers with latest antlr4
Browse files Browse the repository at this point in the history
And update to 4.9.3.

I also removed the generated tokens and interp files as those are not
needed at runtime (source:
https://stackoverflow.com/questions/59734259/antlr-generated-files).

Commands for regenerating:
```
antlr4 -no-listener -package com.ibm.fhir.model.ucum fhir-model/UCUM.g4
&& sed -i.bak $'s/\t/    /g' fhir-model/UCUM*.java && mv
fhir-model/UCUM*.java fhir-model/src/main/java/com/ibm/fhir/model/ucum/
```
```
antlr4 -visitor -no-listener -package com.ibm.fhir.path fhir-path/FHIRPath.g4 &&
sed -i.bak $'s/\t/    /g' fhir-path/FHIRPath*.java && mv
fhir-path/FHIRPath*.java fhir-path/src/main/java/com/ibm/fhir/path/
```

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
  • Loading branch information
lmsurpre committed Nov 17, 2021
1 parent cbd235c commit 5738f9d
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 795 deletions.
55 changes: 0 additions & 55 deletions fhir-model/src/main/java/com/ibm/fhir/model/ucum/UCUM.interp

This file was deleted.

28 changes: 0 additions & 28 deletions fhir-model/src/main/java/com/ibm/fhir/model/ucum/UCUM.tokens

This file was deleted.

62 changes: 0 additions & 62 deletions fhir-model/src/main/java/com/ibm/fhir/model/ucum/UCUMLexer.interp

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/*
* (C) Copyright IBM Corp. 2020, 2021
* (C) Copyright IBM Corp. 2021
*
* SPDX-License-Identifier: Apache-2.0
*/

// Generated from UCUM.g4 by ANTLR 4.9.1
// Generated from fhir-model/UCUM.g4 by ANTLR 4.9.3
package com.ibm.fhir.model.ucum;

import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.RuntimeMetaData;
Expand All @@ -20,7 +19,7 @@

@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class UCUMLexer extends Lexer {
static { RuntimeMetaData.checkVersion("4.9.1", RuntimeMetaData.VERSION); }
static { RuntimeMetaData.checkVersion("4.9.3", RuntimeMetaData.VERSION); }

protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
Expand Down
28 changes: 0 additions & 28 deletions fhir-model/src/main/java/com/ibm/fhir/model/ucum/UCUMLexer.tokens

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/*
* (C) Copyright IBM Corp. 2020, 2021
* (C) Copyright IBM Corp. 2021
*
* SPDX-License-Identifier: Apache-2.0
*/

// Generated from UCUM.g4 by ANTLR 4.9.1
// Generated from fhir-model/UCUM.g4 by ANTLR 4.9.3
package com.ibm.fhir.model.ucum;

import java.util.List;

import org.antlr.v4.runtime.NoViableAltException;
Expand All @@ -27,7 +26,7 @@

@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class UCUMParser extends Parser {
static { RuntimeMetaData.checkVersion("4.9.1", RuntimeMetaData.VERSION); }
static { RuntimeMetaData.checkVersion("4.9.3", RuntimeMetaData.VERSION); }

protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
Expand Down
2 changes: 1 addition & 1 deletion fhir-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.9.1</version>
<version>4.9.3</version>
</dependency>
<dependency>
<groupId>jakarta.mail</groupId>
Expand Down
153 changes: 0 additions & 153 deletions fhir-path/src/main/java/com/ibm/fhir/path/FHIRPath.interp

This file was deleted.

Loading

0 comments on commit 5738f9d

Please sign in to comment.