예제 #1
0
 /**
  * is_blanknode.
  *
  * @param arg a {@link lupos.rif.builtin.Argument} object.
  * @return a {@link lupos.rif.builtin.BooleanLiteral} object.
  */
 @Builtin(Name = "is-blanknode")
 public static BooleanLiteral is_blanknode(final Argument arg) {
   Item arg0 = arg.arguments.get(0);
   if (arg0 instanceof LazyLiteral) {
     arg0 = ((LazyLiteral) arg0).getLiteral();
   }
   return BooleanLiteral.create(arg0 instanceof AnonymousLiteral);
 }
예제 #2
0
 /**
  * is_uri.
  *
  * @param arg a {@link lupos.rif.builtin.Argument} object.
  * @return a {@link lupos.rif.builtin.BooleanLiteral} object.
  */
 @Builtin(Name = "is-uri")
 public static BooleanLiteral is_uri(final Argument arg) {
   Item arg0 = arg.arguments.get(0);
   if (arg0 instanceof LazyLiteral) {
     arg0 = ((LazyLiteral) arg0).getLiteral();
   }
   return BooleanLiteral.create(arg0 instanceof URILiteral);
 }
예제 #3
0
 /**
  * is_literal.
  *
  * @param arg a {@link lupos.rif.builtin.Argument} object.
  * @return a {@link lupos.rif.builtin.BooleanLiteral} object.
  */
 @Builtin(Name = "is-literal")
 public static BooleanLiteral is_literal(final Argument arg) {
   Item arg0 = arg.arguments.get(0);
   if (arg0 instanceof LazyLiteral) {
     arg0 = ((LazyLiteral) arg0).getLiteral();
   }
   return BooleanLiteral.create(!(arg0 instanceof AnonymousLiteral || arg0 instanceof URILiteral));
 }
예제 #4
0
 /**
  * is_integer_expression.
  *
  * @param arg a {@link lupos.rif.builtin.Argument} object.
  * @return a {@link lupos.rif.builtin.BooleanLiteral} object.
  */
 @Builtin(Name = "is-integer-expression")
 public static BooleanLiteral is_integer_expression(final Argument arg) {
   Item arg0 = arg.arguments.get(0);
   if (arg0 instanceof LazyLiteral) {
     arg0 = ((LazyLiteral) arg0).getLiteral();
   }
   final double value = BuiltinHelper.numberFromLiteral((TypedLiteral) arg0);
   return BooleanLiteral.create(Math.round(value) == value);
 }
 /*
  * @see ASTVisitor#visit(BooleanLiteral)
  */
 @Override
 public boolean visit(BooleanLiteral node) {
   if (node.booleanValue() == true) {
     this.fBuffer.append("true"); // $NON-NLS-1$
   } else {
     this.fBuffer.append("false"); // $NON-NLS-1$
   }
   return false;
 }
예제 #6
0
 @Override
 public Void visitBooleanLiteral(BooleanLiteral node) {
   writer.print(node.getLiteral().getLexeme());
   return null;
 }
 @Override
 public void visit(BooleanLiteral expr) {
   stack.add(new Constant(expr.getValue())); // $NON-NLS-1$
 }
 /* (non-Javadoc)
  * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.BooleanLiteral)
  */
 public boolean visit(BooleanLiteral node) {
   PTBooleanLiteral bl = InstantiationFactory.eINSTANCE.createPTBooleanLiteral();
   bl.setBooleanValue(node.booleanValue());
   expression = bl;
   return false;
 }