Tabnine Logo
SignedUnaryNode.getExpression
Code IndexAdd Tabnine to your IDE (free)

How to use
getExpression
method
in
org.kie.dmn.feel.lang.ast.SignedUnaryNode

Best Java code snippets using org.kie.dmn.feel.lang.ast.SignedUnaryNode.getExpression (Showing top 5 results out of 315)

origin: org.kie/kie-dmn-feel

@Override
public DirectCompilerResult visit(SignedUnaryNode n) {
  DirectCompilerResult result = n.getExpression().accept(this);
  if (n.getSign() == SignedUnaryNode.Sign.NEGATIVE) {
    return DirectCompilerResult.of(
        Expressions.negate(result.getExpression()),
        result.resultType,
        result.getFieldDeclarations());
  } else {
    return result;
  }
}
origin: org.kie/kie-dmn-feel

@Test
public void testNegativeFloatLiteral() {
  String inputExpression = "-10.5";
  BaseNode number = parse( inputExpression );
  assertThat( number, is( instanceOf( SignedUnaryNode.class ) ) );
  assertThat( number.getResultType(), is( BuiltInType.NUMBER ) );
  assertLocation( inputExpression, number );
  SignedUnaryNode sun = (SignedUnaryNode) number;
  assertThat( sun.getSign(), is( SignedUnaryNode.Sign.NEGATIVE ) );
  assertThat( sun.getExpression(), is( instanceOf( NumberNode.class ) ) );
  assertThat( sun.getExpression().getText(), is( "10.5" ) );
}
origin: org.kie/kie-dmn-feel

@Test
public void testPositiveIntegerLiteral() {
  String inputExpression = "+10";
  BaseNode number = parse( inputExpression );
  assertThat( number, is( instanceOf( SignedUnaryNode.class ) ) );
  assertThat( number.getResultType(), is( BuiltInType.NUMBER ) );
  assertLocation( inputExpression, number );
  SignedUnaryNode sun = (SignedUnaryNode) number;
  assertThat( sun.getSign(), is( SignedUnaryNode.Sign.POSITIVE ) );
  assertThat( sun.getExpression(), is( instanceOf( NumberNode.class ) ) );
  assertThat( sun.getExpression().getText(), is( "10" ) );
}
origin: org.kie/kie-dmn-feel

@Test
public void testPositiveFloatLiteral() {
  String inputExpression = "+10.5";
  BaseNode number = parse( inputExpression );
  assertThat( number, is( instanceOf( SignedUnaryNode.class ) ) );
  assertThat( number.getResultType(), is( BuiltInType.NUMBER ) );
  assertLocation( inputExpression, number );
  SignedUnaryNode sun = (SignedUnaryNode) number;
  assertThat( sun.getSign(), is( SignedUnaryNode.Sign.POSITIVE ) );
  assertThat( sun.getExpression(), is( instanceOf( NumberNode.class ) ) );
  assertThat( sun.getExpression().getText(), is( "10.5" ) );
}
origin: org.kie/kie-dmn-feel

@Test
public void testNegativeIntegerLiteral() {
  String inputExpression = "-10";
  BaseNode number = parse( inputExpression );
  assertThat( number, is( instanceOf( SignedUnaryNode.class ) ) );
  assertThat( number.getResultType(), is( BuiltInType.NUMBER ) );
  assertLocation( inputExpression, number );
  SignedUnaryNode sun = (SignedUnaryNode) number;
  assertThat( sun.getSign(), is( SignedUnaryNode.Sign.NEGATIVE ) );
  assertThat( sun.getExpression(), is( instanceOf( NumberNode.class ) ) );
  assertThat( sun.getExpression().getText(), is( "10" ) );
}
org.kie.dmn.feel.lang.astSignedUnaryNodegetExpression

Popular methods of SignedUnaryNode

  • getSign
  • <init>
  • astEvent

Popular in Java

  • Reading from database using SQL prepared statement
  • putExtra (Intent)
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • BoxLayout (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now