In smali, the signature of a method that takes two integers and returns a single integer is written like this:
add(II)I
To parse this with xtext, I tried the following:
ID'('Type*')'Type
Unfortunately, this only works with a space between two I
How can I change the rule so that it does not insist on a space here?
As far as I can see, this should already be a problem when the lexer processes terminal rules. Whenever he sees a sequence of characters such as III , he always marks it as an identifier immediately. - Regardless of the situation .: (
To parse something like:
III(III)I
i.e. a function called III , which takes three integers and returns another integer, it seems that I need to make the lexer always select only individual characters and reassemble it using the parser rule.
But in this case, I can no longer create the ID rule ...
I think I missed something important.
NB: In addition to primitive data types such as I (integer), D (double) and V (void), there are also class types written as Ljava/lang/String; and arrays starting with [ .
A typical main method looks like .method public static main([Ljava/lang/String;)V
source share