public class Lexer extends BaseLexer
| 限定符和类型 | 方法和说明 |
|---|---|
JsonParseException |
exceptionFactory(String msg)
抛出一个 JsonParseException 异常
|
JsonParseException |
exceptionFactory(String msg,
Throwable e)
抛出一个 JsonParseException 异常
|
int |
getColNum() |
int |
getCur() |
char |
getCurChar()
获取当前游标所在的字符
|
int |
getLen() |
int |
getLineNum() |
String |
getStr() |
Token |
next()
获取下一个Token的主函数 Next这个方法循环调用nextChar获取下一个字符,碰见某种类型的初始字符,就开始进入相应Token类型的处理函数中
|
isDecimal, isLetterUnderline, isNum, isNumLetterUnderline, isSpacepublic Lexer(String str)
str - 要解析的字符串public char getCurChar()
public Token next()
public JsonParseException exceptionFactory(String msg)
msg - 异常信息public JsonParseException exceptionFactory(String msg, Throwable e)
msg - 异常信息e - 异常对象public int getLineNum()
public int getColNum()
public int getCur()
public String getStr()
public int getLen()
Copyright © 2013–2021 AJAXJS. All rights reserved.