Add GenericToken.getKind() to interface

This commit is contained in:
Maikel Steneker 2020-11-30 16:58:58 +01:00
parent 26728348f6
commit af31b3a773
15 changed files with 73 additions and 0 deletions

View File

@ -132,6 +132,7 @@ public class AntlrToken implements GenericToken {
}
}
@Override
public int getKind() {
return token.getType();
}

View File

@ -51,4 +51,11 @@ public interface GenericToken {
* @return a non-negative integer containing the begin column
*/
int getEndColumn();
/**
* Gets a unique integer representing the kind of token this is.
*
* The semantics of this kind depend on the language.
*/
int getKind();
}

View File

@ -63,6 +63,11 @@ public class BaseTokenFilterTest {
public int getEndColumn() {
return 0;
}
@Override
public int getKind() {
return 0;
}
}
class StringTokenManager implements TokenManager {

View File

@ -88,6 +88,11 @@ public class Token implements GenericToken, java.io.Serializable]]></replacevalu
return endColumn;
}
@Override
public int getKind() {
return kind;
}
]]></replacevalue>
</replace>

View File

@ -130,6 +130,11 @@ public class Token implements GenericToken, java.io.Serializable]]></replacevalu
return endColumn;
}
@Override
public int getKind() {
return kind;
}
]]></replacevalue>
</replace>

View File

@ -88,6 +88,11 @@ public class Token implements GenericToken, java.io.Serializable]]></replacevalu
return endColumn;
}
@Override
public int getKind() {
return kind;
}
]]></replacevalue>
</replace>

View File

@ -108,6 +108,11 @@ public class Token implements GenericToken, java.io.Serializable]]></replacevalu
return endColumn;
}
@Override
public int getKind() {
return kind;
}
]]></replacevalue>
</replace>

View File

@ -88,6 +88,11 @@ public class Token implements GenericToken, java.io.Serializable]]></replacevalu
return endColumn;
}
@Override
public int getKind() {
return kind;
}
]]></replacevalue>
</replace>

View File

@ -120,6 +120,11 @@ public class Token implements GenericToken, java.io.Serializable]]></replacevalu
return endColumn;
}
@Override
public int getKind() {
return kind;
}
]]></replacevalue>
</replace>
<replace>

View File

@ -88,6 +88,11 @@ public class Token implements GenericToken, java.io.Serializable]]></replacevalu
return endColumn;
}
@Override
public int getKind() {
return kind;
}
]]></replacevalue>
</replace>

View File

@ -141,6 +141,11 @@ public class Token implements GenericToken, java.io.Serializable]]></replacevalu
return endColumn;
}
@Override
public int getKind() {
return kind;
}
]]></replacevalue>
</replace>

View File

@ -88,6 +88,11 @@ public class Token implements GenericToken, java.io.Serializable]]></replacevalu
return endColumn;
}
@Override
public int getKind() {
return kind;
}
]]></replacevalue>
</replace>

View File

@ -56,6 +56,11 @@ public class ScalaTokenAdapter implements GenericToken {
return token.pos().endColumn() + 1;
}
@Override
public int getKind() {
throw new UnsupportedOperationException();
}
@Override
public String toString() {
return "ScalaTokenAdapter{"

View File

@ -108,6 +108,11 @@ public class Token implements GenericToken, java.io.Serializable]]></replacevalu
return endColumn;
}
@Override
public int getKind() {
return kind;
}
]]></replacevalue>
</replace>

View File

@ -121,6 +121,11 @@ public class Token implements GenericToken, java.io.Serializable]]></replacevalu
return endColumn;
}
@Override
public int getKind() {
return kind;
}
]]></replacevalue>
</replace>