mirror of
https://github.com/revanced/smali.git
synced 2025-05-28 20:00:13 +02:00
Updated the token emmission mechanism to include token line/column info
git-svn-id: https://smali.googlecode.com/svn/trunk@100 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
9cbaa76e44
commit
e186646752
@ -161,20 +161,29 @@ import java.util.ArrayDeque;
|
||||
tokens.add(Token.SKIP_TOKEN);
|
||||
}
|
||||
|
||||
public void emit(Token token) {
|
||||
tokens.add(token);
|
||||
}
|
||||
|
||||
public void emit(Token token, int type) {
|
||||
token.setType(type);
|
||||
tokens.add(token);
|
||||
}
|
||||
|
||||
public void emit(Token token, int type, int channel) {
|
||||
token.setType(type);
|
||||
token.setChannel(channel);
|
||||
tokens.add(token);
|
||||
}
|
||||
public void emit(Token token) {
|
||||
token.setLine(state.tokenStartLine);
|
||||
token.setText(state.text);
|
||||
token.setCharPositionInLine(state.tokenStartCharPositionInLine);
|
||||
tokens.add(token);
|
||||
}
|
||||
|
||||
public void emit(Token token, int type) {
|
||||
token.setLine(state.tokenStartLine);
|
||||
token.setText(state.text);
|
||||
token.setCharPositionInLine(state.tokenStartCharPositionInLine);
|
||||
token.setType(type);
|
||||
tokens.add(token);
|
||||
}
|
||||
|
||||
public void emit(Token token, int type, int channel) {
|
||||
token.setLine(state.tokenStartLine);
|
||||
token.setText(state.text);
|
||||
token.setCharPositionInLine(state.tokenStartCharPositionInLine);
|
||||
token.setType(type);
|
||||
token.setChannel(channel);
|
||||
tokens.add(token);
|
||||
}
|
||||
|
||||
public String getErrorHeader(RecognitionException e) {
|
||||
return getSourceName()+"["+ e.line+","+e.charPositionInLine+"]";
|
||||
|
Loading…
x
Reference in New Issue
Block a user