Commit 76c4dcf6 authored by Kristof Szabados's avatar Kristof Szabados

could be final.

Signed-off-by: Kristof Szabados's avatarKristof Szabados <Kristof.Szabados@ericsson.com>
parent 75463e45
......@@ -36,25 +36,24 @@ public class VariantAttributeAnalyzer {
public void parse(final RawAST rawAST, final AttributeSpecification specification, final int lengthMultiplier, final AtomicBoolean raw_found) {
VariantAttributeLexer lexer;
Location location = specification.getLocation();
final Location location = specification.getLocation();
StringReader reader = new StringReader(specification.getSpecification());
CharStream charStream = new UnbufferedCharStream(reader);
final StringReader reader = new StringReader(specification.getSpecification());
final CharStream charStream = new UnbufferedCharStream(reader);
lexer = new VariantAttributeLexer(charStream);
lexer.setTokenFactory(new CommonTokenFactory(true));
TitanListener lexerListener = new TitanListener();
final TitanListener lexerListener = new TitanListener();
lexer.removeErrorListeners();
lexer.addErrorListener(lexerListener);
final CommonTokenStream tokenStream = new CommonTokenStream( lexer );
VariantAttributeParser parser = new VariantAttributeParser( tokenStream );
final VariantAttributeParser parser = new VariantAttributeParser( tokenStream );
parser.setBuildParseTree(false);
TitanListener parserListener = new TitanListener();
final TitanListener parserListener = new TitanListener();
parser.removeErrorListeners();
parser.addErrorListener(parserListener);
parser.setActualFile((IFile)location.getFile());
parser.setLine(location.getLine());
parser.setOffset(location.getOffset() + 1);
......@@ -68,14 +67,14 @@ public class VariantAttributeAnalyzer {
if (!lexerListener.getErrorsStored().isEmpty()) {
for (int i = 0; i < lexerListener.getErrorsStored().size(); i++) {
Location temp = new Location(location);
final Location temp = new Location(location);
temp.setOffset(temp.getOffset() + 1);
ParserMarkerSupport.createOnTheFlyMixedMarker((IFile) location.getFile(), lexerListener.getErrorsStored().get(i), IMarker.SEVERITY_ERROR, temp);
}
}
if (!parserListener.getErrorsStored().isEmpty()) {
for (int i = 0; i < parserListener.getErrorsStored().size(); i++) {
Location temp = new Location(location);
final Location temp = new Location(location);
temp.setOffset(temp.getOffset() + 1);
ParserMarkerSupport.createOnTheFlyMixedMarker((IFile) location.getFile(), parserListener.getErrorsStored().get(i), IMarker.SEVERITY_ERROR, temp);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment