-
Notifications
You must be signed in to change notification settings - Fork 13
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
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,69 @@ | |||
// Copyright (c) 2002-2014 JavaMOP Team. All Rights Reserved. |
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.
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. | ||
* |
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.
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) { |
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.
Should there really be a ClassOrInterfaceType argument here? If yes, how (and where) is that argument created in the first place?
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.
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.*; |
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.
do we use all classes in the package? how many are there?
break; | ||
case Short: | ||
printer.print("short"); | ||
break; |
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.
missing a default case?
, "List<List<Bar>>" | ||
, adviceParams.get(0).getType().toString()); | ||
|
||
} |
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.
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.*; |
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.
you don't use any class from java.io
package rvm; | ||
|
||
import java.io.*; | ||
import java.util.*; |
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.
import only the List class that you use
|
||
import java.io.*; | ||
import java.util.*; | ||
|
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.
you don't use any class from java.io
import only the List class that you use
|
||
import java.io.*; | ||
import java.util.*; | ||
|
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.
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(): |
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.
use List instead of List?
{ | ||
String id; | ||
int line, column; | ||
List ret = new LinkedList(); |
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 sometimes use ArrayList(e.g, RVParameters) and sometimes use LinkedList?
Generics like
List<Foo>
will now parse