mirror of
https://github.com/revanced/smali.git
synced 2025-05-31 12:50: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);
|
tokens.add(Token.SKIP_TOKEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void emit(Token token) {
|
public void emit(Token token) {
|
||||||
tokens.add(token);
|
token.setLine(state.tokenStartLine);
|
||||||
}
|
token.setText(state.text);
|
||||||
|
token.setCharPositionInLine(state.tokenStartCharPositionInLine);
|
||||||
|
tokens.add(token);
|
||||||
|
}
|
||||||
|
|
||||||
public void emit(Token token, int type) {
|
public void emit(Token token, int type) {
|
||||||
token.setType(type);
|
token.setLine(state.tokenStartLine);
|
||||||
tokens.add(token);
|
token.setText(state.text);
|
||||||
}
|
token.setCharPositionInLine(state.tokenStartCharPositionInLine);
|
||||||
|
token.setType(type);
|
||||||
|
tokens.add(token);
|
||||||
|
}
|
||||||
|
|
||||||
public void emit(Token token, int type, int channel) {
|
public void emit(Token token, int type, int channel) {
|
||||||
token.setType(type);
|
token.setLine(state.tokenStartLine);
|
||||||
token.setChannel(channel);
|
token.setText(state.text);
|
||||||
tokens.add(token);
|
token.setCharPositionInLine(state.tokenStartCharPositionInLine);
|
||||||
}
|
token.setType(type);
|
||||||
|
token.setChannel(channel);
|
||||||
|
tokens.add(token);
|
||||||
|
}
|
||||||
|
|
||||||
public String getErrorHeader(RecognitionException e) {
|
public String getErrorHeader(RecognitionException e) {
|
||||||
return getSourceName()+"["+ e.line+","+e.charPositionInLine+"]";
|
return getSourceName()+"["+ e.line+","+e.charPositionInLine+"]";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user