Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync/cdr 423 enhance sdk parser #376

Merged
merged 20 commits into from
Jul 26, 2022
Merged

Conversation

stefanspiska
Copy link
Contributor

No description provided.

@stefanspiska stefanspiska marked this pull request as ready for review July 22, 2022 06:26
@@ -30,7 +30,10 @@ topExpr
// | TOP INTEGER FORWARD ;

function
: FUNCTION_IDENTIFIER OPEN_PAR (IDENTIFIER|identifiedPath|operand) (COMMA (IDENTIFIER|identifiedPath|operand))* CLOSE_PAR;
: FUNCTION_IDENTIFIER OPEN_PAR (IDENTIFIER|identifiedPath|operand|) (COMMA (IDENTIFIER|identifiedPath|operand))* CLOSE_PAR;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am aware it is from the other grammar, but this would also parse e.g. CONCAT( , "x").
How about FUNCTION_IDENTIFIER OPEN_PAR ((IDENTIFIER|identifiedPath|operand) (COMMA (IDENTIFIER|identifiedPath|operand))*)? CLOSE_PAR ?

* @author Stefan Spiska
*/
public enum PerformanceTestCase implements AqlTestDto {
Query1(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum constants should be upper case

testAql(testData);
}

void testAql(AqlTestDto testData) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename to assertRoundTrip?

return (SelectAqlField) Function.avg(bind(dto.getParameters().get(0), containmentMap), dto.getName());
default:
throw new AqlParseException(String.format(
"Unsupported Funktion %s", dto.getAqlFunction().name()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo "Unsupported Function"

@@ -15,30 +15,40 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ehrbase.webtemplate.parser;
package org.ehrbase.aql.dto.path;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should have different models for web template paths and aql paths?

*/
public class PredicateHelper {

public static final String[] PREDICATE_DIVIDERS = {" and ", " AND ", " or ", " OR ", ","};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exposing a final array may be problematic. It is sorted (over and over again) in AqlPath::split.
Maybe somehow wrap the search operation here?
Also, this seems to introduce a circular dependency with AqlPath.

see CDR-411
@stefanspiska stefanspiska merged commit dc89440 into develop Jul 26, 2022
@stefanspiska stefanspiska deleted the sync/CDR-423_enhance_sdk_parser branch July 26, 2022 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants