Examples of JapidParser


Examples of cn.bran.japid.compiler.JapidParser

  }

  @Test
  public void testBackquoteAlone() {
    String src = "hello \n  `\n ss\n`  ";
    JapidParser p = new JapidParser(src);
    List<TokenPair> tokens = p.allTokens();
//    dumpTokens(tokens);
    assertEquals(4, tokens.size());
    assertEquals(Token.PLAIN, tokens.get(0).token);
    assertEquals(Token.SCRIPT_LINE, tokens.get(1).token);
    assertEquals(Token.PLAIN, tokens.get(2).token);
View Full Code Here

Examples of cn.bran.japid.compiler.JapidParser

   */
  @Test
  public void testPatenthesisInTagInocation() {
    String src = "#{tag a, b.goo() | String c/}";
    List<String> tokens = new ArrayList<String>();
    JapidParser p = new JapidParser(src);
    loop: for (;;) {
      JapidParser.Token state = p.nextToken();
      switch (state) {
      case EOF:
        break loop;
      default:
        String tokenstring = p.getToken();
        tokens.add(tokenstring);
        System.out.println(state.name() + ": [" + tokenstring + "]");
      }
    }
  }
View Full Code Here

Examples of cn.bran.japid.compiler.JapidParser

  }
 
  @Test
  public void testScriptline() {
    String src = "hello `t Tag2 \"123\"`!";
    JapidParser p = new JapidParser(src);
    List<TokenPair> tokens = p.allTokens();
//    dumpTokens(tokens);
    assertEquals(3, tokens.size());
    assertEquals(Token.PLAIN, tokens.get(0).token);
    assertEquals(Token.SCRIPT_LINE, tokens.get(1).token);
    assertEquals(Token.PLAIN, tokens.get(2).token);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.