Tabnine Logo
InfixOperator
Code IndexAdd Tabnine to your IDE (free)

How to use
InfixOperator
in
org.matheclipse.parser.client.operator

Best Java code snippets using org.matheclipse.parser.client.operator.InfixOperator (Showing top 20 results out of 315)

origin: org.appdapter/ext.bundle.math.symja_jas

static public InfixOperator createInfixOperator(final String operatorStr, final String headStr, final int precedence,
    final int grouping) {
  InfixOperator oper;
  if (headStr.equals("Divide")) {
    oper = new DivideOperator(operatorStr, headStr, precedence, grouping);
  } else if (headStr.equals("Subtract")) {
    oper = new SubtractOperator(operatorStr, headStr, precedence, grouping);
  } else {
    oper = new InfixOperator(operatorStr, headStr, precedence, grouping);
  }
  return oper;
}
origin: axkr/symja_android_library

private final ASTNode parseInfixOperator(ASTNode lhs, InfixOperator infixOperator) {
  ASTNode rhs;
  rhs = parseLookaheadOperator(infixOperator.getPrecedence());
  lhs = infixOperator.createFunction(fFactory, lhs, rhs);
  String infixOperatorString = infixOperator.getOperatorString();
  while (fToken == TT_OPERATOR && infixOperator.getGrouping() == InfixOperator.NONE
      && infixOperatorString.equals(fOperatorString)) {
    getNextToken();
    if (";".equals(infixOperatorString)) {
      if (fToken == TT_EOF || fToken == TT_ARGUMENTS_CLOSE || fToken == TT_LIST_CLOSE
          || fToken == TT_PRECEDENCE_CLOSE || fToken == TT_COMMA) {
        ((FunctionNode) lhs).add(fFactory.createSymbol("Null"));
        break;
      }
    }
    while (fToken == TT_NEWLINE) {
      getNextToken();
    }
    rhs = parseLookaheadOperator(infixOperator.getPrecedence());
    ((FunctionNode) lhs).add(rhs);
  }
  return lhs;
}
origin: org.refcodes/refcodes-criteria

final InfixOperator iOper = (DivideOperator) oper;
String grouping = null;
if ( iOper.getGrouping() == InfixOperator.NONE ) {
  grouping = "InfixOperator.NONE";
else if ( iOper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE ) {
  grouping = "InfixOperator.LEFT_ASSOCIATIVE";
else if ( iOper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE ) {
  grouping = "InfixOperator.RIGHT_ASSOCIATIVE";
System.out.println( "    new DivideOperator(\"" + iOper.getOperatorString() + "\", \"" + iOper.getFunctionName() + "\", " + iOper.getPrecedence() + ", " + grouping + ")," );
if ( iOper.getGrouping() == InfixOperator.NONE ) {
  grouping = "InfixOperator.NONE";
else if ( iOper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE ) {
  grouping = "InfixOperator.LEFT_ASSOCIATIVE";
else if ( iOper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE ) {
  grouping = "InfixOperator.RIGHT_ASSOCIATIVE";
System.out.println( "    new SubtractOperator(\"" + iOper.getOperatorString() + "\", \"" + iOper.getFunctionName() + "\", " + iOper.getPrecedence() + ", " + grouping + ")," );
if ( iOper.getGrouping() == InfixOperator.NONE ) {
  grouping = "InfixOperator.NONE";
else if ( iOper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE ) {
  grouping = "InfixOperator.LEFT_ASSOCIATIVE";
origin: axkr/symja_android_library

private ASTNode parseCompoundExpressionNull(InfixOperator infixOperator, ASTNode rhs) {
  if (infixOperator.isOperator(";")) {
    if (fToken == TT_EOF || fToken == TT_ARGUMENTS_CLOSE || fToken == TT_LIST_CLOSE
        || fToken == TT_PRECEDENCE_CLOSE || fToken == TT_COMMA) {
      return infixOperator.createFunction(fFactory, rhs, fFactory.createSymbol("Null"));
    }
    if (fPackageMode && fRecursionDepth < 1) {
      return infixOperator.createFunction(fFactory, rhs, fFactory.createSymbol("Null"));
    }
  }
  return null;
}
origin: org.appdapter/ext.bundle.math.symja_jas

public void convertBinaryOperator(final Writer buf, final IAST list, final InfixOperator oper, final int precedence)
    throws IOException {
  if (oper.getPrecedence() < precedence) {
    buf.write("(");
  }
  if (list.size() > 1) {
    convert(buf, list.get(1), oper.getPrecedence());
  }
  for (int i = 2; i < list.size(); i++) {
    buf.write(oper.getOperatorString());
    convert(buf, list.get(i), oper.getPrecedence());
  }
  if (oper.getPrecedence() < precedence) {
    buf.write(")");
  }
}
origin: axkr/symja_android_library

if (oper.getPrecedence() < precedence) {
  append(buf, "(");
if (oper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE && list.arg1().head().equals(list.head())) {
  append(buf, "(");
} else {
  if (oper.getOperatorString() == "^") {
    final Operator operator = getOperator(list.arg1().topHead());
    if (operator instanceof PostfixOperator) {
convert(buf, list.arg1(), oper.getPrecedence(), false);
if (oper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE && list.arg1().head().equals(list.head())) {
  append(buf, ")");
} else {
  if (oper.getOperatorString() == "^") {
    final Operator operator = getOperator(list.arg1().topHead());
    if (operator instanceof PostfixOperator) {
append(buf, oper.getOperatorString());
if (oper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE && list.arg2().head().equals(list.head())) {
  append(buf, "(");
convert(buf, list.arg2(), oper.getPrecedence(), false);
if (oper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE && list.arg2().head().equals(list.head())) {
  append(buf, ")");
if (oper.getPrecedence() < precedence) {
  append(buf, ")");
origin: axkr/symja_android_library

if (Config.DOMINANT_IMPLICIT_TIMES || timesOperator.getPrecedence() > min_precedence) {
  rhs = parseExpression(rhs, timesOperator.getPrecedence());
  continue;
} else if ((timesOperator.getPrecedence() == min_precedence)
    && (timesOperator.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE)) {
  rhs = parseExpression(rhs, timesOperator.getPrecedence());
  continue;
if (infixOperator.getPrecedence() > min_precedence
    || ((infixOperator.getPrecedence() == min_precedence)
        && (infixOperator.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE))) {
  if (infixOperator.isOperator(";")) {
    if (fPackageMode && fRecursionDepth < 1) {
      return infixOperator.createFunction(fFactory, rhs, fFactory.createSymbol("Null"));
  rhs = parseExpression(rhs, infixOperator.getPrecedence());
  continue;
origin: org.appdapter/ext.bundle.math.symja_jas

if (timesOperator.getPrecedence() > min_precedence) {
  rhs = parseOperators(rhs, timesOperator.getPrecedence());
  continue;
} else if ((timesOperator.getPrecedence() == min_precedence)
    && (timesOperator.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE)) {
  rhs = parseOperators(rhs, timesOperator.getPrecedence());
  continue;
  if (infixOperator.getPrecedence() > min_precedence) {
    rhs = parseOperators(rhs, infixOperator.getPrecedence());
    continue;
  } else if ((infixOperator.getPrecedence() == min_precedence)
      && (infixOperator.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE)) {
    rhs = parseOperators(rhs, infixOperator.getPrecedence());
    continue;
origin: org.refcodes/refcodes-criteria

if ( infixOperator.getPrecedence() >= min_precedence ) {
  getNextToken();
  rhs = parseLookaheadOperator( infixOperator.getPrecedence() );
  lhs = infixOperator.createFunction( fFactory, lhs, rhs );
  lhs = parseArguments( lhs );
  continue;
origin: org.appdapter/ext.bundle.math.symja_jas

  public ASTNode createFunction(final IParserFactory factory,
      final ASTNode lhs, final ASTNode rhs) {
    return factory.createFunction(factory.createSymbol(getFunctionName()),
        lhs, rhs);
  }
}
origin: axkr/symja_android_library

private void convertPlusOperator(final Appendable buf, final IAST plusAST, final InfixOperator oper,
    final int precedence) throws IOException {
  int operPrecedence = oper.getPrecedence();
  if (operPrecedence < precedence) {
    append(buf, "(");
  }
  IExpr plusArg;
  int size = plusAST.size();
  if (size > 0) {
    convertPlusArgument(buf, plusAST.arg1(), NO_PLUS_CALL);
    for (int i = 2; i < size; i++) {
      plusArg = plusAST.get(i);
      convertPlusArgument(buf, plusArg, PLUS_CALL);
    }
  }
  if (operPrecedence < precedence) {
    append(buf, ")");
  }
}
origin: axkr/symja_android_library

} else if (list.size() != 3 && infixOperator.getGrouping() != InfixOperator.NONE) {
  return false;
origin: org.appdapter/ext.bundle.math.symja_jas

private void convertTimesOperator(final Writer buf, final IAST list, final InfixOperator oper, final int precedence)
    throws IOException {
  boolean showOperator = true;
  int currPrecedence = oper.getPrecedence();
  if (currPrecedence < precedence) {
    buf.write("(");
      } else {
        if (((ISignedNumber) list.get(1)).isNegative()) {
          convertNumber(buf, (INumber) list.get(1), oper.getPrecedence());
        } else {
          convert(buf, list.get(1), oper.getPrecedence());
      convert(buf, list.get(1), oper.getPrecedence());
      buf.write(oper.getOperatorString());
    } else {
      showOperator = true;
    convert(buf, list.get(i), oper.getPrecedence());
origin: axkr/symja_android_library

  if (oper.getPrecedence() < precedence) {
  if (oper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE && list.arg1().head().equals(list.head())) {
  convert(buf, list.arg1(), oper.getPrecedence(), false);
  if (oper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE && list.arg1().head().equals(list.head())) {
  tag(buf, "mo", oper.getOperatorString());
  if (oper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE && list.arg2().head().equals(list.head())) {
  convert(buf, list.arg2(), oper.getPrecedence(), false);
  if (oper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE && list.arg2().head().equals(list.head())) {
  if (oper.getPrecedence() < precedence) {
if (oper.getPrecedence() < precedence) {
  convert(buf, list.arg1(), oper.getPrecedence(), false);
  tag(buf, "mo", oper.getOperatorString());
  convert(buf, list.get(i), oper.getPrecedence(), false);
if (oper.getPrecedence() < precedence) {
origin: org.refcodes/refcodes-criteria

if ( timesOperator.getPrecedence() > min_precedence ) {
  rhs = parseOperators( rhs, timesOperator.getPrecedence() );
  continue;
else if ( (timesOperator.getPrecedence() == min_precedence) && (timesOperator.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE) ) {
  rhs = parseOperators( rhs, timesOperator.getPrecedence() );
  continue;
  if ( infixOperator.getPrecedence() > min_precedence ) {
    rhs = parseOperators( rhs, infixOperator.getPrecedence() );
    continue;
  else if ( (infixOperator.getPrecedence() == min_precedence) && (infixOperator.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE) ) {
    rhs = parseOperators( rhs, infixOperator.getPrecedence() );
    continue;
origin: org.appdapter/ext.bundle.math.symja_jas

if (infixOperator.getPrecedence() >= min_precedence) {
  getNextToken();
  rhs = parseLookaheadOperator(infixOperator.getPrecedence());
  lhs = infixOperator.createFunction(fFactory, lhs, rhs);
  lhs = parseArguments(lhs);
  continue;
origin: org.refcodes/refcodes-criteria

  /**
   * Creates the function.
   * 
   * @param factory the factory
   * @param lhs the lhs
   * @param rhs the rhs
   * @return the AST node
   */
  public ASTNode createFunction( final IParserFactory factory, final ASTNode lhs, final ASTNode rhs ) {
    return factory.createFunction( factory.createSymbol( getFunctionName() ), lhs, rhs );
  }
}
origin: axkr/symja_android_library

if (infixOperator.getPrecedence() >= min_precedence) {
origin: axkr/symja_android_library

} else if (list.size() != 3 && infixOperator.getGrouping() != InfixOperator.NONE) {
  return false;
origin: org.appdapter/ext.bundle.math.symja_jas

  final InfixOperator iOper = (DivideOperator) oper;
  String grouping = null;
  if (iOper.getGrouping() == InfixOperator.NONE) {
    grouping = "InfixOperator.NONE";
  } else if (iOper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE) {
    grouping = "InfixOperator.LEFT_ASSOCIATIVE";
  } else if (iOper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE) {
    grouping = "InfixOperator.RIGHT_ASSOCIATIVE";
  System.out.println("    new DivideOperator(\"" + iOper.getOperatorString() + "\", \"" + iOper.getFunctionName() + "\", "
      + iOper.getPrecedence() + ", " + grouping + "),");
} else if (oper instanceof SubtractOperator) {
  final InfixOperator iOper = (SubtractOperator) oper;
  String grouping = null;
  if (iOper.getGrouping() == InfixOperator.NONE) {
    grouping = "InfixOperator.NONE";
  } else if (iOper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE) {
    grouping = "InfixOperator.LEFT_ASSOCIATIVE";
  } else if (iOper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE) {
    grouping = "InfixOperator.RIGHT_ASSOCIATIVE";
  System.out.println("    new SubtractOperator(\"" + iOper.getOperatorString() + "\", \"" + iOper.getFunctionName()
      + "\", " + iOper.getPrecedence() + ", " + grouping + "),");
} else if (oper instanceof InfixOperator) {
  final InfixOperator iOper = (InfixOperator) oper;
  String grouping = null;
  if (iOper.getGrouping() == InfixOperator.NONE) {
    grouping = "InfixOperator.NONE";
  } else if (iOper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE) {
org.matheclipse.parser.client.operatorInfixOperator

Javadoc

The Class InfixOperator.

Most used methods

  • <init>
    Instantiates a new infix operator.
  • createFunction
    Creates the function.
  • getFunctionName
  • getGrouping
    Return the grouping of the Infix-Operator (i.e. NONE,LEFT_ASSOCIATIVE, RIGHT_ASSOCIATIVE)
  • getOperatorString
  • getPrecedence
  • isOperator

Popular in Java

  • Making http post requests using okhttp
  • requestLocationUpdates (LocationManager)
  • getExternalFilesDir (Context)
  • findViewById (Activity)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • String (java.lang)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • CodeWhisperer alternatives
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