-
Notifications
You must be signed in to change notification settings - Fork 24
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
Feature/semantic #253
base: master
Are you sure you want to change the base?
Feature/semantic #253
Conversation
Dockerfile
Outdated
@@ -16,6 +16,23 @@ RUN if [ "$DEBUG" = "true" ]; then apt-get update \ | |||
&& apt-get install --no-install-recommends -y gdb gdbserver \ | |||
&& apt-get clean; fi | |||
|
|||
WORKDIR "${HOME}" | |||
RUN mkdir antlr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, variable HOME is pointing to /home/ubuntu. This antlr folder should get created inside the following path. Not at HOME.
/home/ubuntu/software
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay sir, I'll put into this location, "/home/ubuntu/software". but after moving the generated files in to JasmineGraph, we don't need this folder anymore then this home/ubuntu/antlr folder get cleared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
frontend_logger.log("AST is succssusfully analyzed", "log"); | ||
}else | ||
{ | ||
frontend_logger.error("query isn't semantically correct"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add the query also as part of the error message. This will give more details and support for debugging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay sir I will add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
#include "ASTLeafValue.h" | ||
#include "/home/ubuntu/software/jasminegraph/code_generated/antlr/CypherBaseVisitor.h" | ||
|
||
any visitOC_Cypher(CypherParser::OC_CypherContext *ctx) ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reorder the appearance of the function definitions in alphabetical order of the letters appearing after _. For example visitOC_Cypher
we should use the letter C
and the y
if needed for alphabetical sorting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the order is very similar to hierarchy of the cypher grammar rule set. and this order was defined by antlr4 then it can be helpful for debugging. if it is necessary, I can re-order it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case lets not re-order the functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay sir.
|
||
|
||
|
||
any ASTBuilder::visitOC_Cypher(CypherParser::OC_CypherContext *ctx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets arrange these function declarations also based on the order of the function definitions appearance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the order is very similar to hierarchy of the cypher grammar rule set. and this order was defined by antlr4 then it can be helpful for debugging. if it is necessary, I can re-arrange it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case lets not re-order the functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay sir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have put some comments. Please address each of them and explain how you handled it.
{ | ||
return false; | ||
} | ||
}else if(root->nodeType == "VARIABLE") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move these literals to some constants and refer them here? I see same literal repeated several times here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure sir, I will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Its ok the way you have set the util folder currently.
}else if (root->nodeType == "AS") | ||
{ | ||
string ntype; | ||
if (root->elements[0]->nodeType == "LIST" || root->elements[0]->nodeType == "LIST_COMPREHENSION") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can there be scenario where root->elements
becoming null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sir, it cannot be null, but it can be empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
|
||
// Report errors | ||
void SemanticAnalyzer::reportError(const std::string &message, ASTNode* node) { | ||
std::cerr << "Error: " << message << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a logger here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure sir, I will fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but there are some further changes required. Please check my new comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have put some comments on this PR. Please address them all and explain in each comment on how you addressed those.
CMakeLists.txt
Outdated
) | ||
|
||
if (CMAKE_BUILD_TYPE STREQUAL "DEBUG") | ||
add_compile_options(-DUNIT_TEST) | ||
endif () | ||
|
||
add_library(JasmineGraphLib ${HEADERS} ${SOURCES}) | ||
file(GLOB GENERATED_SRC ${CMAKE_SOURCE_DIR}/code_generated/antlr/*.cpp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where we will have the code_generated
folder in the directory structure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
home/ubuntu/software/jasminegraph/code_generated/antlr/*.cpp
this is the path to the code_generated folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
Dockerfile
Outdated
@@ -1,4 +1,4 @@ | |||
FROM miyurud/jasminegraph-prerequisites:20240101T095619 | |||
FROM pre:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we change the base image here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was mistakenly commited my locally used prerequisite image. now I edited it and push it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
Quality Gate passedIssues Measures |
add semantic analyzer