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

Ilyas RIAH #19

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Ilyas RIAH #19

wants to merge 4 commits into from

Conversation

iIyas-RIAH
Copy link

No description provided.


for (StmtWrapper BoolExpWrapper : BoolExpWrappers) {
Matcher matcher = Pattern
.compile("(([\\\\w\\\\d\\\\s.])+(==|!=|<|>|>=|<=)[\\\\w\\\\d\\\\s.]+([&\\\\|]{2})?)+")
Copy link
Owner

Choose a reason for hiding this comment

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

regex expression is too long, maintenance will be hard

compilationUnit.accept(new IfElseVisitor(),ifElseWrappers);

for(StmtWrapper ifElseWrapper: ifElseWrappers){
Matcher matcher = Pattern.compile(".*\\{([\\S\\s]*)\\}").matcher(ifElseWrapper.getStatement().toString());
Copy link
Owner

Choose a reason for hiding this comment

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

use visitor pattern

public class ClassVisitor extends VoidVisitorAdapter<List<ClassWrapper>> {

@Override
public void visit(ClassOrInterfaceDeclaration CID, List<ClassWrapper> arg) {
Copy link
Owner

Choose a reason for hiding this comment

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

CID is not a valid variable name

private String variableDeclaration(Statement statement) {
Matcher m = Pattern.compile("[\\w]+\\s+([\\w]+)\\s*(=\\s*[\\w\\s()]+)?;")
.matcher(statement.toString().replace("return", ""));
if (m.find())
Copy link
Owner

Choose a reason for hiding this comment

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

if statement must have curly braces

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants