Examples of ParseState


Examples of com.caucho.jsp.ParseState

    if (_file == null)
      throw error(L.l("<{0}> needs a 'file' attribute.",
                      getTagName()));

    try {
      ParseState parseState = _gen.getParseState();
     
      if (parseState.isXml()) {
        Xml xml = new Xml();
        xml.setContentHandler(new JspContentHandler(parseState.getBuilder()));
        Path path = resolvePath(_file, parseState);

        path.setUserPath(_file);
        xml.setNamespaceAware(true);

        for (Namespace ns = parseState.getNamespaces();
             ns != null;
             ns = ns.getNext()) {
          xml.pushNamespace(ns.getPrefix(), ns.getURI());
        }
View Full Code Here

Examples of com.caucho.jsp.ParseState

    if (_file == null)
      throw error(L.l("<{0}> needs a 'file' attribute.",
                      getTagName()));

    try {
      ParseState parseState = _gen.getParseState();
     
      if (parseState.isXml()) {
  Xml xml = new Xml();
  xml.setContentHandler(new JspContentHandler(parseState.getBuilder()));
  Path path = resolvePath(_file, parseState);
 
  path.setUserPath(_file);
  xml.setNamespaceAware(true);

  for (Namespace ns = parseState.getNamespaces();
       ns != null;
       ns = ns.getNext()) {
    xml.pushNamespace(ns.getPrefix(), ns.getURI());
  }
 
View Full Code Here

Examples of org.renjin.parser.ParseState

  @Override
  public Token getTokenList(Segment text, int initialTokenType, int startOffset) {
  
    ParseOptions parseOptions = new ParseOptions();
    ParseState parseState = new ParseState();
   
    if(startOffset != text.getBeginIndex()) {
      System.out.println("startOffset = " + startOffset);
    }
   
View Full Code Here

Examples of org.renjin.parser.ParseState

 
  @Override
  public void run() {

    ParseOptions options = ParseOptions.defaults();
    ParseState state = new ParseState();
    Reader reader = console.getIn();
    RLexer lexer = new RLexer(options, state, reader);
    RParser parser = new RParser(options, state, lexer);

    printGreeting();
View Full Code Here

Examples of org.renjin.parser.ParseState

    assertTokenSequence(source, list);
  }

  private void assertTokenSequence(String source, LexExpectation... expects) {
    Reader reader = new StringReader(source);
    RLexer lexer = new RLexer(ParseOptions.defaults(), new ParseState(), reader);

    for (int i = 0; i != expects.length; ++i) {
      assertThat("token " + (i + 1), lexer.yylex(), equalTo(expects[i].expectedToken));
      assertThat(lexer.getLVal(), expects[i].sexpMatcher);
    }
View Full Code Here

Examples of org.renjin.parser.ParseState

  private boolean readExpression() throws Exception {

    reader.setPrompt("> ");

    ParseOptions options = new ParseOptions();
    ParseState parseState = new ParseState();
    JlineReader lineReader = new JlineReader(reader);
    lineReader.setEcho(echo);
    lineReader.setEchoOut(reader.getOutput());

    RLexer lexer = new RLexer(options, parseState, lineReader);
View Full Code Here

Examples of org.renjin.parser.ParseState

    return topLevelContext.evaluate( exp );
  }

  private SEXP parse(String source)  {
    try {
      ParseState state = new ParseState();
      ParseOptions options = ParseOptions.defaults();
      RLexer lexer = new RLexer(options, state, new StringReader(source));
      RParser parser = new RParser(options, state, lexer);

      assertThat("parser.parse succeeds", parser.parse(), equalTo(true));
View Full Code Here

Examples of org.springframework.beans.factory.parsing.ParseState

public class ParseStateTests extends TestCase {

  public void testSimple() throws Exception {
    MockEntry entry = new MockEntry();

    ParseState parseState = new ParseState();
    parseState.push(entry);
    assertEquals("Incorrect peek value.", entry, parseState.peek());
    parseState.pop();
    assertNull("Should get null on peek()", parseState.peek());
  }
View Full Code Here

Examples of org.springframework.beans.factory.parsing.ParseState

  public void testNesting() throws Exception {
    MockEntry one = new MockEntry();
    MockEntry two = new MockEntry();
    MockEntry three = new MockEntry();

    ParseState parseState = new ParseState();
    parseState.push(one);
    assertEquals(one, parseState.peek());
    parseState.push(two);
    assertEquals(two, parseState.peek());
    parseState.push(three);
    assertEquals(three, parseState.peek());

    parseState.pop();
    assertEquals(two, parseState.peek());
    parseState.pop();
    assertEquals(one, parseState.peek());
  }
View Full Code Here

Examples of org.springframework.beans.factory.parsing.ParseState

  }

  public void testSnapshot() throws Exception {
    MockEntry entry = new MockEntry();

    ParseState original = new ParseState();
    original.push(entry);

    ParseState snapshot = original.snapshot();
    original.push(new MockEntry());
    assertEquals("Snapshot should not have been modified.", entry, snapshot.peek());
  }
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.