mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
tests: java: factor the definition of Position
* tests/local.at (AT_JAVA_POSITION_DEFINE): New. * tests/java.at, tests/javapush.at: Use it.
This commit is contained in:
@@ -158,43 +158,7 @@ AT_LOCATION_IF([[
|
||||
};
|
||||
%%]], [[
|
||||
}]])[
|
||||
|
||||
class Position {
|
||||
public int line;
|
||||
public int token;
|
||||
|
||||
public Position ()
|
||||
{
|
||||
line = 0;
|
||||
token = 0;
|
||||
}
|
||||
|
||||
public Position (int l, int t)
|
||||
{
|
||||
line = l;
|
||||
token = t;
|
||||
}
|
||||
|
||||
public boolean equals (Position l)
|
||||
{
|
||||
return l.line == line && l.token == token;
|
||||
}
|
||||
|
||||
public String toString ()
|
||||
{
|
||||
return Integer.toString (line) + "." + Integer.toString(token);
|
||||
}
|
||||
|
||||
public int lineno ()
|
||||
{
|
||||
return line;
|
||||
}
|
||||
|
||||
public int token ()
|
||||
{
|
||||
return token;
|
||||
}
|
||||
}
|
||||
]AT_JAVA_POSITION_DEFINE[
|
||||
]])
|
||||
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
|
||||
Reference in New Issue
Block a user