Examples of FPLParser


Examples of edu.cmu.cs.fusion.parsers.predicate.FPLParser

public class ParseBinaryPredicate {
  @Test
  public void testAndPredicate() throws ParseException {
    String string = "a AND b";
   
    FPLParser parser = new FPLParser(string, null, null);
    Predicate pred = parser.expression();
   
    Assert.assertTrue("Parsed predicate should be a AndPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof AndPredicate);
   
    AndPredicate val = (AndPredicate)pred;
   
View Full Code Here

Examples of edu.cmu.cs.fusion.parsers.predicate.FPLParser

 
  @Test
  public void testAnd2Predicate() throws ParseException {
    String string = "a AND b AND c";
   
    FPLParser parser = new FPLParser(string, null, null);
    Predicate pred = parser.expression();
   
    Assert.assertTrue("Parsed predicate should be a AndPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof AndPredicate);
   
    AndPredicate val = (AndPredicate)pred;
   
View Full Code Here

Examples of edu.cmu.cs.fusion.parsers.predicate.FPLParser

 
  @Test
  public void testAnd3ParenPredicate() throws ParseException {
    String string = "a AND (b AND (c AND d))";
   
    FPLParser parser = new FPLParser(string, null, null);
    Predicate pred = parser.expression();
   
    Assert.assertTrue("Parsed predicate should be a AndPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof AndPredicate);   
    AndPredicate val = (AndPredicate)pred;
   
    Assert.assertTrue("Left side is a bool value", val.getLeft() instanceof BooleanValue);
View Full Code Here

Examples of edu.cmu.cs.fusion.parsers.predicate.FPLParser

 
  @Test
  public void testOrAndPredicate() throws ParseException {
    String string = "c OR b AND a";
   
    FPLParser parser = new FPLParser(string, null, null);
    Predicate pred = parser.expression();
   
    Assert.assertTrue("Parsed predicate should be a OrPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof OrPredicate);
   
    OrPredicate val = (OrPredicate)pred;
   
View Full Code Here

Examples of edu.cmu.cs.fusion.parsers.predicate.FPLParser

  @Test
  public void testOrAndParenPredicate() throws ParseException {
    String string = "(c OR b) AND a";
   
    FPLParser parser = new FPLParser(string, null, null);
    Predicate pred = parser.expression();
   
    Assert.assertTrue("Parsed predicate should be a AndPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof AndPredicate);
   
    AndPredicate val = (AndPredicate)pred;
   
View Full Code Here

Examples of edu.cmu.cs.fusion.parsers.predicate.FPLParser

  @Test
  public void testOrPredicate() throws ParseException {
    String string = "a OR b";
   
    FPLParser parser = new FPLParser(string, null, null);
    Predicate pred = parser.expression();
   
    Assert.assertTrue("Parsed predicate should be a OrPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof OrPredicate);
   
    OrPredicate val = (OrPredicate)pred;
   
View Full Code Here

Examples of edu.cmu.cs.fusion.parsers.predicate.FPLParser

 
  @Test
  public void testOr2Predicate() throws ParseException {
    String string = "a OR b OR c";
   
    FPLParser parser = new FPLParser(string, null, null);
    Predicate pred = parser.expression();
   
    Assert.assertTrue("Parsed predicate should be a OrPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof OrPredicate);
   
    OrPredicate val = (OrPredicate)pred;
   
View Full Code Here

Examples of edu.cmu.cs.fusion.parsers.predicate.FPLParser

  @Test
  public void testImpliesOrPredicate() throws ParseException {
    String string = "c IMPLIES b OR a";
   
    FPLParser parser = new FPLParser(string, null, null);
    Predicate pred = parser.expression();
   
    Assert.assertTrue("Parsed predicate should be a ImpliesPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof ImpliesPredicate);
   
    ImpliesPredicate val = (ImpliesPredicate)pred;
   
View Full Code Here

Examples of edu.cmu.cs.fusion.parsers.predicate.FPLParser

 
  @Test
  public void testImpliesOrParenPredicate() throws ParseException {
    String string = "(c IMPLIES b) OR a";
   
    FPLParser parser = new FPLParser(string, null, null);
    Predicate pred = parser.expression();
   
    Assert.assertTrue("Parsed predicate should be a ImpliesPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof OrPredicate);
   
    OrPredicate val = (OrPredicate)pred;
   
View Full Code Here

Examples of edu.cmu.cs.fusion.parsers.predicate.FPLParser

  @Test
  public void testImpliesPredicate() throws ParseException {
    String string = "a IMPLIES b";
   
    FPLParser parser = new FPLParser(string, null, null);
    Predicate pred = parser.expression();
   
    Assert.assertTrue("Parsed predicate should be a ImpliesPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof ImpliesPredicate);
   
    ImpliesPredicate val = (ImpliesPredicate)pred;
   
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.