forked from hadrienk/java-vtl
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/expression-statement-refactoring
- Loading branch information
Showing
16 changed files
with
193 additions
and
324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
59 changes: 0 additions & 59 deletions
59
java-vtl-dependency-parser/src/main/java/no/ssb/vtl/dependencies/Assignment.java
This file was deleted.
Oops, something went wrong.
65 changes: 0 additions & 65 deletions
65
java-vtl-dependency-parser/src/main/java/no/ssb/vtl/dependencies/AssignmentListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +0,0 @@ | ||
package no.ssb.vtl.dependencies; | ||
|
||
/*- | ||
* ========================LICENSE_START================================= | ||
* Java VTL | ||
* %% | ||
* Copyright (C) 2016 - 2017 Hadrien Kohl | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* =========================LICENSE_END================================== | ||
*/ | ||
|
||
import com.google.common.collect.ImmutableSet; | ||
import no.ssb.vtl.parser.VTLBaseListener; | ||
import no.ssb.vtl.parser.VTLParser; | ||
|
||
import java.util.HashMap; | ||
import java.util.HashSet; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
public class AssignmentListener extends VTLBaseListener { | ||
|
||
private Map<String, Assignment> variableDependency; | ||
|
||
private Set<ComponentRef> componentRefs = new HashSet<>(); | ||
|
||
public AssignmentListener() { | ||
variableDependency = new HashMap<>(); | ||
} | ||
|
||
@Override | ||
public void exitJoinCalcClause(VTLParser.JoinCalcClauseContext ctx) { | ||
String identifier = ctx.variable().getText(); | ||
String expression = ctx.getText(); | ||
Assignment assignment = | ||
new Assignment(identifier, expression,ImmutableSet.copyOf(componentRefs)); | ||
variableDependency.put(identifier, assignment); | ||
componentRefs.clear(); | ||
} | ||
|
||
@Override | ||
public void exitComponentRef(VTLParser.ComponentRefContext ctx) { | ||
|
||
String datasetRef = ctx.datasetRef().getText(); | ||
String variableRef = ctx.variable().getText(); | ||
componentRefs.add(new ComponentRef(datasetRef, variableRef)); | ||
} | ||
|
||
public Map<String, Assignment> getVariableDependency() { | ||
return variableDependency; | ||
} | ||
|
||
} | ||
|
||
45 changes: 0 additions & 45 deletions
45
java-vtl-dependency-parser/src/main/java/no/ssb/vtl/dependencies/ComponentRef.java
This file was deleted.
Oops, something went wrong.
52 changes: 0 additions & 52 deletions
52
java-vtl-dependency-parser/src/main/java/no/ssb/vtl/dependencies/DependencyParser.java
This file was deleted.
Oops, something went wrong.
52 changes: 0 additions & 52 deletions
52
java-vtl-dependency-parser/src/test/java/no/ssb/vtl/dependencies/DependencyParserTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.