Skip to content

Commit

Permalink
Version 1.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gquerret committed May 10, 2016
1 parent 77e4096 commit 0a63d73
Show file tree
Hide file tree
Showing 36 changed files with 263 additions and 2,619 deletions.
4 changes: 3 additions & 1 deletion BaseTokenTypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1204,4 +1204,6 @@ PARENTIDRELATION=1206
PARENTIDFIELD=1207
PARENTFIELDSBEFORE=1208
PARENTFIELDSAFTER=1209
Last_Token_Number=1210
ENUM=1210
FLAGS=1211
Last_Token_Number=1212
4 changes: 3 additions & 1 deletion ProParserTokenTypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1202,4 +1202,6 @@ PARENTIDRELATION=1206
PARENTIDFIELD=1207
PARENTFIELDSBEFORE=1208
PARENTFIELDSAFTER=1209
Last_Token_Number=1210
ENUM=1210
FLAGS=1211
Last_Token_Number=1212
2 changes: 1 addition & 1 deletion database-parser/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>eu.rssw.openedge.parsers</groupId>
<artifactId>database-parser</artifactId>
<version>1.1.9</version>
<version>1.1.10</version>

<name>OpenEdge database definition lexer and parser</name>
<url>http://riverside-software.fr/</url>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package eu.rssw.antlr.database;

import java.io.PrintStream;

import eu.rssw.antlr.database.DumpFileGrammarParser.AddFieldContext;
import eu.rssw.antlr.database.DumpFileGrammarParser.AddIndexContext;
import eu.rssw.antlr.database.DumpFileGrammarParser.AddSequenceContext;
Expand All @@ -13,35 +15,40 @@
import eu.rssw.antlr.database.DumpFileGrammarParser.UpdateTableContext;

public class DumpFileReleaseDescriptor extends DumpFileGrammarBaseVisitor<Void> {
private final PrintStream out;

public DumpFileReleaseDescriptor(PrintStream stream) {
this.out = stream;
}

// *************
// FIELD SECTION
// *************

@Override
public Void visitAddField(AddFieldContext ctx) {
System.out.printf("a FIELD %1$s.%2$s [%3$s]%n", ctx.table.getText(), ctx.field.getText(), ctx.dataType.getText());
out.printf("a FIELD %1$s.%2$s [%3$s]%n", ctx.table.getText(), ctx.field.getText(), ctx.dataType.getText());

return visitChildren(ctx);
}

@Override
public Void visitDropField(DropFieldContext ctx) {
System.out.printf("d FIELD %1$s.%2$s%n", ctx.table.getText(), ctx.field.getText());
out.printf("d FIELD %1$s.%2$s%n", ctx.table.getText(), ctx.field.getText());

return visitChildren(ctx);
}

@Override
public Void visitRenameField(RenameFieldContext ctx) {
System.out.printf("r FIELD %1$s.%2$s --> %3$s%n", ctx.table.getText(), ctx.from.getText(), ctx.to.getText());
out.printf("r FIELD %1$s.%2$s --> %3$s%n", ctx.table.getText(), ctx.from.getText(), ctx.to.getText());

return visitChildren(ctx);
}

@Override
public Void visitUpdateField(UpdateFieldContext ctx) {
System.out.printf("m FIELD %1$s.%2$s%n", ctx.table.getText(), ctx.field.getText());
out.printf("m FIELD %1$s.%2$s%n", ctx.table.getText(), ctx.field.getText());

return visitChildren(ctx);
}
Expand All @@ -52,21 +59,21 @@ public Void visitUpdateField(UpdateFieldContext ctx) {

@Override
public Void visitAddTable(AddTableContext ctx) {
System.out.printf("a TABLE %1$s%n", ctx.table.getText());
out.printf("a TABLE %1$s%n", ctx.table.getText());

return visitChildren(ctx);
}

@Override
public Void visitDropTable(DropTableContext ctx) {
System.out.printf("d TABLE %1$s%n", ctx.table.getText());
out.printf("d TABLE %1$s%n", ctx.table.getText());

return visitChildren(ctx);
}

@Override
public Void visitUpdateTable(UpdateTableContext ctx) {
System.out.printf("m TABLE %1$s%n", ctx.table.getText());
out.printf("m TABLE %1$s%n", ctx.table.getText());

return visitChildren(ctx);
}
Expand All @@ -77,21 +84,21 @@ public Void visitUpdateTable(UpdateTableContext ctx) {

@Override
public Void visitAddIndex(AddIndexContext ctx) {
System.out.printf("a INDEX %1$s.%2$s%n", ctx.table.getText(), ctx.index.getText());
out.printf("a INDEX %1$s.%2$s%n", ctx.table.getText(), ctx.index.getText());

return visitChildren(ctx);
}

@Override
public Void visitDropIndex(DropIndexContext ctx) {
System.out.printf("d INDEX %1$s.%2$s%n", ctx.table.getText(), ctx.index.getText());
out.printf("d INDEX %1$s.%2$s%n", ctx.table.getText(), ctx.index.getText());

return visitChildren(ctx);
}

@Override
public Void visitUpdateIndex(UpdateIndexContext ctx) {
System.out.printf("m INDEX %1$s.%2$s%n", ctx.table.getText(), ctx.index.getText());
out.printf("m INDEX %1$s.%2$s%n", ctx.table.getText(), ctx.index.getText());

return visitChildren(ctx);
}
Expand All @@ -102,7 +109,7 @@ public Void visitUpdateIndex(UpdateIndexContext ctx) {

@Override
public Void visitAddSequence(AddSequenceContext ctx) {
System.out.printf("a SEQUENCE %1$s%n", ctx.sequence.getText());
out.printf("a SEQUENCE %1$s%n", ctx.sequence.getText());

return visitChildren(ctx);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

public final class DumpFileUtils {

private DumpFileUtils() {
// Not instantiated
}

public static final ParseTree getDumpFileParseTree(File file) throws IOException {
// Quick and dirty
LineProcessor<Charset> charsetReader = new LineProcessor<Charset>() {
Expand All @@ -35,9 +39,7 @@ public boolean processLine(String arg0) throws IOException {
if (arg0.startsWith("cpstream=")) {
try {
charset = Charset.forName(arg0.substring(9));
} catch (IllegalCharsetNameException uncaught) {
// Undefined for example...
} catch (UnsupportedCharsetException uncaught) {
} catch (IllegalCharsetNameException | UnsupportedCharsetException uncaught) {
// Undefined for example...
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@
public class DumpFileVisitor extends DumpFileGrammarBaseVisitor<Void> {
private DatabaseDescription db;

private Deque<Table> tables = new ArrayDeque<Table>();
private Deque<Field> fields = new ArrayDeque<Field>();
private Deque<Sequence> sequences = new ArrayDeque<Sequence>();
private Deque<Index> indexes = new ArrayDeque<Index>();

public DatabaseDescription getDatabase() {
return db;
}
private Deque<Table> tables = new ArrayDeque<>();
private Deque<Field> fields = new ArrayDeque<>();
private Deque<Sequence> sequences = new ArrayDeque<>();
private Deque<Index> indexes = new ArrayDeque<>();

public DumpFileVisitor(String dbName) {
this.db = new DatabaseDescription(dbName);
}

public DatabaseDescription getDatabase() {
return db;
}

// *************
// FIELD SECTION
// *************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

public class DatabaseDescription {
private String dbName;
private Map<String, Sequence> sequences = new HashMap<String, Sequence>();
private Map<String, Table> tables = new HashMap<String, Table>();
private Map<String, Sequence> sequences = new HashMap<>();
private Map<String, Table> tables = new HashMap<>();

public DatabaseDescription(String dbName) {
this.dbName = dbName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class Index {
private final String name;
private String area;
private boolean primary, unique, word;
private List<IndexField> fields = new ArrayList<IndexField>();
private List<IndexField> fields = new ArrayList<>();

private int firstLine, lastLine;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
public class Table {
private final String name;
private String area, label, description, dumpName, valMsg;
private Collection<Field> fields = new ArrayList<Field>();
private Collection<Index> indexes = new ArrayList<Index>();
private Collection<Trigger> triggers = new ArrayList<Trigger>();
private Collection<Field> fields = new ArrayList<>();
private Collection<Index> indexes = new ArrayList<>();
private Collection<Trigger> triggers = new ArrayList<>();

private int firstLine, lastLine;

Expand Down
4 changes: 2 additions & 2 deletions openedge-checks-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>eu.rssw.openedge.checks</groupId>
<artifactId>openedge-checks-shaded</artifactId>
<version>1.3.3</version>
<version>1.3.4</version>

<name>OpenEdge checks (shaded)</name>
<url>http://riverside-software.fr/</url>
Expand All @@ -31,7 +31,7 @@
<dependency>
<groupId>eu.rssw.openedge.checks</groupId>
<artifactId>openedge-checks</artifactId>
<version>1.3.3</version>
<version>1.3.4</version>
</dependency>
<dependency>
<groupId>eu.rssw.openedge.parsers</groupId>
Expand Down
6 changes: 3 additions & 3 deletions openedge-checks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>eu.rssw.openedge.checks</groupId>
<artifactId>openedge-checks</artifactId>
<version>1.3.3</version>
<version>1.3.4</version>

<name>OpenEdge checks</name>
<url>http://riverside-software.fr/</url>
Expand Down Expand Up @@ -38,12 +38,12 @@
<dependency>
<groupId>eu.rssw.openedge.parsers</groupId>
<artifactId>database-parser</artifactId>
<version>1.1.9</version>
<version>1.1.10</version>
</dependency>
<dependency>
<groupId>proparse</groupId>
<artifactId>proparse</artifactId>
<version>1.0.5</version>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.common.io.Resources;

/**
* Utility class which helps setting up an implementation of {@link RulesDefinition} with a list of rule classes
Expand Down
4 changes: 2 additions & 2 deletions openedge-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>eu.rssw.sonar.openedge</groupId>
<artifactId>sonar-openedge-plugin</artifactId>
<version>1.9.0</version>
<version>1.9.1</version>
<packaging>sonar-plugin</packaging>

<name>OpenEdge plugin for SonarQube</name>
Expand Down Expand Up @@ -68,7 +68,7 @@
<dependency>
<groupId>eu.rssw.openedge.checks</groupId>
<artifactId>openedge-checks-shaded</artifactId>
<version>1.3.3</version>
<version>1.3.4</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.sonar.plugins.openedge.foundation.OpenEdge;
import org.sonar.plugins.openedge.foundation.OpenEdgeComponents;
import org.sonar.plugins.openedge.foundation.OpenEdgeDB;
import org.sonar.plugins.openedge.foundation.OpenEdgeDBProfile;
import org.sonar.plugins.openedge.foundation.OpenEdgeLicenceRegistrar;
import org.sonar.plugins.openedge.foundation.OpenEdgeMetrics;
import org.sonar.plugins.openedge.foundation.OpenEdgeProfile;
Expand Down Expand Up @@ -77,6 +78,7 @@ public List getExtensions() {
list.add(OpenEdgeRulesRegistrar.class);
list.add(OpenEdgeLicenceRegistrar.class);
list.add(OpenEdgeProfile.class);
list.add(OpenEdgeDBProfile.class);
list.add(OpenEdgeMetrics.class);
list.add(OpenEdgeComponents.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.sonar.colorizer.MultilinesDocTokenizer;
import org.sonar.colorizer.Tokenizer;
import org.sonar.plugins.openedge.api.com.google.common.collect.ImmutableList;
import org.sonar.plugins.openedge.api.org.prorefactor.core.NodeTypes;
import org.sonar.plugins.openedge.foundation.OpenEdge;

@SuppressWarnings("deprecation")
Expand All @@ -43,7 +44,8 @@ public OpenEdgeColorizerFormat() {

@Override
public List<Tokenizer> getTokenizers() {
KeywordsTokenizer kwTokenizer = new KeywordsTokenizer(SPAN_KEYWORD, SPAN_END, OpenEdgeKeywords.get(),

KeywordsTokenizer kwTokenizer = new KeywordsTokenizer(SPAN_KEYWORD, SPAN_END, NodeTypes.getAllKeywords(),
"[a-zA-Z_][a-zA-Z0-9_\\x2D]*+");
kwTokenizer.setCaseInsensitive(true);

Expand Down
Loading

0 comments on commit 0a63d73

Please sign in to comment.