Package games.stendhal.common.parser

Examples of games.stendhal.common.parser.ExpressionMatcher.parseSentence()


   */
  @Test
  public final void testParsing() {
    final ExpressionMatcher matcher = new ExpressionMatcher();

    Sentence sentence = matcher.parseSentence("", new ConversationContext());
    assertFalse(sentence.hasError());
    assertEquals("", sentence.toString());

    String str = matcher.readMatchingFlags("Lazy dog");
    assertEquals("Lazy dog", str);
View Full Code Here


    String str = matcher.readMatchingFlags("Lazy dog");
    assertEquals("Lazy dog", str);
    assertTrue(matcher.isEmpty());
    assertEquals("", matcher.toString());

    sentence = matcher.parseSentence(str, new ConversationContext());
    assertFalse(sentence.hasError());
    assertEquals("lazy dog/SUB-ANI", sentence.toString());

    str = matcher.readMatchingFlags("|TYPE|abcdef/OBJ");
    assertEquals("abcdef/OBJ", str);
View Full Code Here

    assertTrue(matcher.isAnyFlagSet());
    assertFalse(matcher.getExactMatching());
    assertTrue(matcher.getTypeMatching());
    assertEquals("|TYPE", matcher.toString());

    sentence = matcher.parseSentence(str, new ConversationContext());
    assertFalse(sentence.hasError());
    assertEquals("|TYPE|abcdef/OBJ", sentence.toString());

    str = matcher.readMatchingFlags("|EXACT|Hello world!");
    assertEquals("Hello world!", str);
View Full Code Here

    assertTrue(matcher.isAnyFlagSet());
    assertTrue(matcher.getExactMatching());
    assertFalse(matcher.getTypeMatching());
    assertEquals("|EXACT", matcher.toString());

    sentence = matcher.parseSentence(str, new ConversationContext());
    assertFalse(sentence.hasError());
    assertEquals("|EXACT|Hello world!", sentence.toString());
  }

  /**
 
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.