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

Support Parsing Generics in Advice Parameters Types #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

msaxena2
Copy link
Contributor

Generics like List<Foo> will now parse

@@ -0,0 +1,69 @@
// Copyright (c) 2002-2014 JavaMOP Team. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: We should change the copyright license (in another PR) to be until 2020 (or remove the years).

Also, should the copyright be for the RV-Monitor team (not JavaMOP team)?

// Copyright (c) 2002-2014 JavaMOP Team. All Rights Reserved.
/*
* Copyright (C) 2007 Julio Vilmar Gesser.
*
Copy link
Contributor

@owolabileg owolabileg Jun 26, 2020

Choose a reason for hiding this comment

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

Minor: why do we have two copyright owners?


private final List<Type> typeArgs;

public ClassOrInterfaceType(int line, int column, ClassOrInterfaceType scope, String name, List<Type> typeArgs) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there really be a ClassOrInterfaceType argument here? If yes, how (and where) is that argument created in the first place?

Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be a ClassOrInterface?

@@ -34,6 +35,7 @@
import com.runtimeverification.rvmonitor.java.rvj.parser.ast.rvmspec.RVMParameters;
import com.runtimeverification.rvmonitor.java.rvj.parser.ast.rvmspec.RVMonitorSpec;
import com.runtimeverification.rvmonitor.java.rvj.parser.ast.rvmspec.SpecModifierSet;
import com.runtimeverification.rvmonitor.java.rvj.parser.ast.type.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

do we use all classes in the package? how many are there?

break;
case Short:
printer.print("short");
break;
Copy link
Contributor

Choose a reason for hiding this comment

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

missing a default case?

, "List<List<Bar>>"
, adviceParams.get(0).getType().toString());

}
Copy link
Contributor

Choose a reason for hiding this comment

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

Some of the types that are being parsed in this PR are not tested, e.g., WildCardType, VoidType. Please add tests for those.

Also, can you please add a few tests for non-generic parameters, so we know those work as well?

@@ -0,0 +1,16 @@
package rvm;

import java.io.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

you don't use any class from java.io

package rvm;

import java.io.*;
import java.util.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

import only the List class that you use


import java.io.*;
import java.util.*;

Copy link
Contributor

Choose a reason for hiding this comment

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

you don't use any class from java.io

import only the List class that you use


import java.io.*;
import java.util.*;

Copy link
Contributor

Choose a reason for hiding this comment

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

you don't use any class from java.io

import only the List class that you use

("[" {id += token.image;} "]" {id += token.image;})*
["+" {id += token.image;}]
{ return new BaseTypePattern(line, column, id); }
}

BaseTypePattern TypePattern():
List TypeArguments():
Copy link
Contributor

Choose a reason for hiding this comment

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

use List instead of List?

{
String id;
int line, column;
List ret = new LinkedList();
Copy link
Contributor

Choose a reason for hiding this comment

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

why sometimes use ArrayList(e.g, RVParameters) and sometimes use LinkedList?

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.

3 participants