gpt4 book ai didi

org.json.simple.parser.Yylex类的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 14:10:49 33 4
gpt4 key购买 nike

本文整理了Java中org.json.simple.parser.Yylex类的一些代码示例,展示了Yylex类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Yylex类的具体详情如下:
包路径:org.json.simple.parser.Yylex
类名称:Yylex

Yylex介绍

暂无

代码示例

代码示例来源:origin: com.googlecode.json-simple/json-simple

private void nextToken() throws ParseException, IOException{
  token = lexer.yylex();
  if(token == null)
    token = new Yytoken(Yytoken.TYPE_EOF, null);
}

代码示例来源:origin: com.googlecode.json-simple/json-simple

boolean eof = zzRefill();
 { sb.append(yytext());
 { sb.delete(0, sb.length());yybegin(STRING_BEGIN);
 { Boolean val=Boolean.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);
 { yybegin(YYINITIAL);return new Yytoken(Yytoken.TYPE_VALUE, sb.toString());
 { Double val=Double.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);
 { throw new ParseException(yychar, ParseException.ERROR_UNEXPECTED_CHAR, new Character(yycharat(0)));
case 24: 
 { try{
                        int ch=Integer.parseInt(yytext().substring(2),16);
                        sb.append((char)ch);
 { Long val=Long.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);
  zzScanError(ZZ_NO_MATCH);

代码示例来源:origin: com.googlecode.json-simple/json-simple

/**
 * @return The position of the beginning of the current token.
 */
public int getPosition(){
  return lexer.getPosition();
}

代码示例来源:origin: com.googlecode.json-simple/json-simple

/**
 * Pushes the specified amount of characters back into the input stream.
 *
 * They will be read again by then next call of the scanning method
 *
 * @param number  the number of characters to be read again.
 *                This number must not be greater than yylength()!
 */
public void yypushback(int number)  {
 if ( number > yylength() )
  zzScanError(ZZ_PUSHBACK_2BIG);
 zzMarkedPos -= number;
}

代码示例来源:origin: BiglySoftware/BiglyBT

yy_mark_start();
yy_this_accept = yy_acpt[yy_state];
if (YY_NOT_ACCEPT != yy_this_accept) {
  yy_last_accept_state = yy_state;
  yy_mark_end();
  else yy_lookahead = yy_advance();
  yy_next_state = YY_F;
  yy_next_state = yy_nxt[yy_rmap[yy_state]][yy_cmap[yy_lookahead]];
    if (YY_NOT_ACCEPT != yy_this_accept) {
      yy_last_accept_state = yy_state;
      yy_mark_end();
      yy_anchor = yy_acpt[yy_last_accept_state];
      if (0 != (YY_END & yy_anchor)) {
        yy_move_end();
      yy_to_mark();
      switch (yy_last_accept_state) {
      case 1:
        break;
      case 2:
        { sb.delete(0,sb.length());yybegin(STRING_BEGIN);}
      case -3:
        break;
      case 3:
        { Long val=Long.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE,val);}

代码示例来源:origin: stackoverflow.com

Map<String,Integer> map = new TreeMap<>();
Yylex yy = new Yylex(System.in);
Yytoken t;
while ((t = yy.yylex()) != null) {
 String text = t.mText;

代码示例来源:origin: com.googlecode.json-simple/json-simple

/**
 * Reset the parser to the initial state with a new character reader.
 * 
 * @param in - The new character reader.
 * @throws IOException
 * @throws ParseException
 */
public void reset(Reader in){
  lexer.yyreset(in);
  reset();
}

代码示例来源:origin: com.googlecode.json-simple/json-simple

private static int [] zzUnpackAction() {
 int [] result = new int[45];
 int offset = 0;
 offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
 return result;
}

代码示例来源:origin: i2p/i2p.i2p

/**
 * Pushes the specified amount of characters back into the input stream.
 *
 * They will be read again by then next call of the scanning method
 *
 * @param number  the number of characters to be read again.
 *                This number must not be greater than yylength()!
 */
public void yypushback(int number)  {
 if ( number > yylength() )
  zzScanError(ZZ_PUSHBACK_2BIG);
 zzMarkedPos -= number;
}

代码示例来源:origin: BiglySoftware/BiglyBT

public Object parse(Reader in) throws Exception{
  Stack statusStack=new Stack();
  Stack valueStack=new Stack();
  Yylex lexer=new Yylex(in);
  Yytoken token=null;
  int status=S_INIT;
      token=lexer.yylex();
      if(token==null)
        token=new Yytoken(Yytoken.TYPE_EOF,null);

代码示例来源:origin: i2p/i2p.i2p

/**
 * Reset the parser to the initial state with a new character reader.
 * 
 * @param in - The new character reader.
 */
public void reset(Reader in){
  lexer.yyreset(in);
  reset();
}

代码示例来源:origin: i2p/i2p.i2p

private static int [] zzUnpackAction() {
 int [] result = new int[45];
 int offset = 0;
 offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
 return result;
}

代码示例来源:origin: i2p/i2p.i2p

boolean eof = zzRefill();
 { sb.append(yytext());
 { sb.delete(0, sb.length());yybegin(STRING_BEGIN);
 { Boolean val=Boolean.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);
 { yybegin(YYINITIAL);return new Yytoken(Yytoken.TYPE_VALUE, sb.toString());
 { Double val=Double.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);
 { throw new ParseException(yychar, ParseException.ERROR_UNEXPECTED_CHAR, new Character(yycharat(0)));
case 24: 
 { try{
                        int ch=Integer.parseInt(yytext().substring(2),16);
                        sb.append((char)ch);
 { Long val=Long.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);
  zzScanError(ZZ_NO_MATCH);

代码示例来源:origin: childe/hangout

/**
 * Pushes the specified amount of characters back into the input stream.
 *
 * They will be read again by then next call of the scanning method
 *
 * @param number  the number of characters to be read again.
 *                This number must not be greater than yylength()!
 */
public void yypushback(int number)  {
 if ( number > yylength() )
  zzScanError(ZZ_PUSHBACK_2BIG);
 zzMarkedPos -= number;
}

代码示例来源:origin: i2p/i2p.i2p

private void nextToken() throws ParseException, IOException{
  token = lexer.yylex();
  if(token == null)
    token = new Yytoken(Yytoken.TYPE_EOF, null);
}

代码示例来源:origin: fangyidong/json-simple

/**
 * Reset the parser to the initial state with a new character reader.
 * 
 * @param in - The new character reader.
 * @throws IOException
 * @throws ParseException
 */
public void reset(Reader in){
  lexer.yyreset(in);
  reset();
}

代码示例来源:origin: i2p/i2p.i2p

/**
 * @return The position of the beginning of the current token.
 */
public int getPosition(){
  return lexer.getPosition();
}

代码示例来源:origin: fangyidong/json-simple

private static int [] zzUnpackAction() {
 int [] result = new int[45];
 int offset = 0;
 offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
 return result;
}

代码示例来源:origin: fangyidong/json-simple

boolean eof = zzRefill();
 { sb.append(yytext());
 { sb = null; sb = new StringBuffer(); yybegin(STRING_BEGIN);
 { Boolean val=Boolean.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);
 { yybegin(YYINITIAL);return new Yytoken(Yytoken.TYPE_VALUE, sb.toString());
 { Double val=Double.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);
 { throw new ParseException(yychar, ParseException.ERROR_UNEXPECTED_CHAR, new Character(yycharat(0)));
case 24: 
 { try{
                        int ch=Integer.parseInt(yytext().substring(2),16);
                        sb.append((char)ch);
 { Long val=Long.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);
  zzScanError(ZZ_NO_MATCH);

代码示例来源:origin: fangyidong/json-simple

/**
 * Pushes the specified amount of characters back into the input stream.
 *
 * They will be read again by then next call of the scanning method
 *
 * @param number  the number of characters to be read again.
 *                This number must not be greater than yylength()!
 */
public void yypushback(int number)  {
 if ( number > yylength() )
  zzScanError(ZZ_PUSHBACK_2BIG);
 zzMarkedPos -= number;
}

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com