Giter VIP home page Giter VIP logo

aqlparser's Issues

small issues

  • octal should go up to 7, not 8
  • our date format is more extended than the specification grammar. Probably keep as is (see text in spec!) but note on top of file
  • the IDENTIFIER starts with aA subcase is to prevent conflict with at-codes. looks like it's no longer needed in ANTLR4 because of the longest match gaining preference, and the at-code having priority over the IDENTIFIER, as it probably should be?

Review feedback

My first round of feedback:

This is unused.

public AQLValidationException(Exception e) {
super(e);
}

This is unused.

@Override
public void validate() {
new ArchetypeHRID(getValue());
}

This throws an IllegalArgumentException instead of an AQLValidationException as other validate methods do. Please catch the IllegalArgumentException and convert it to an AQLValidationException.

public ClassExprOperand getClassExprOperand() {
return getLookup().getClassExprOperand(getVariableName());
}

This is unused. I'm not sure why.

public Boolean isCompositionPath() {
String identifier = pathParts.get(0).getIdentifier().toLowerCase();
//Check if first identifier equals
switch (identifier) {
case "language":
case "territory":
case "category":
case "context":
case "composer":
case "content":
return true;
default:
return false;
}
}

Some of these attributes are also attributes on other RM classes, e.g. language is also an attribute on OBSERVATION and DV_TEXT. Can't this be solved another way?

import java.time.LocalDateTime;
import java.time.OffsetDateTime;

These are unused.

public Operator(String type) {
this.type = OperatorType.get(type);
}

This is unused.

public String getParameterKey(PrimitiveOperand primitiveOperand) {
return parameter.entrySet().stream().filter(primitiveOperand::equals).map(Map.Entry::getKey).findFirst().get();
}

I don't think this works. I think you mean

filter(entry -> primitiveOperand.equals(entry.getValue()))

protected void addChild(ParseTree parseTree) {

This is unused.

All protected methods in NodeExpression can be changed to private.

final QOMParser visitor = new QOMParser(lookup);
QOMObject object = visitor.visit(parseTree);

can be changed to

QOMObject object = QOMParserUtil.parse(lookup, parseTree);

Then this class doesn't need to extend AQLBaseVisitor anymore and private Lookup lookup;, the constructor and public QOMObject visitChildren(RuleNode node) { ... } can be removed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.