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

How to use
ParseTokenNumber
in
cc.redberry.core.parser

Best Java code snippets using cc.redberry.core.parser.ParseTokenNumber (Showing top 5 results out of 315)

origin: cc.redberry/core

@Override
protected ParseToken inverseOperation(ParseToken node) {
  return new ParseToken(TokenType.Power, node, new ParseTokenNumber(Complex.MINUS_ONE));
}
origin: cc.redberry/core

@Override
protected ParseToken inverseOperation(ParseToken node) {
  ParseToken[] content;
  if (node.tokenType == TokenType.Product) {
    content = new ParseToken[1 + node.content.length];
    content[0] = new ParseTokenNumber(Complex.MINUS_ONE);
    System.arraycopy(node.content, 0, content, 1, node.content.length);
  } else
    content = new ParseToken[]{
        new ParseTokenNumber(Complex.MINUS_ONE),
        node
    };
  return new ParseToken(TokenType.Product, content);
}
origin: cc.redberry/core

@Override
public ParseToken parseToken(String expression, cc.redberry.core.parser.Parser parser) {
  Complex value;
  try {
    value = NumberParser.COMPLEX_PARSER.parse(expression);
  } catch (NumberFormatException e) {
    return null;
  }
  return new ParseTokenNumber(value);
}
origin: cc.redberry/core

  && arguments.size() == 1
  && arguments.get(0).getIndices().getFree().size() == 0)
return new ParseToken(TokenType.Power, new ParseToken[]{arguments.get(0), new ParseTokenNumber(Complex.ONE_HALF)});
origin: cc.redberry/core

public static ParseToken tensor2AST(Tensor tensor) {
  if (tensor instanceof TensorField) {
    TensorField tf = (TensorField) tensor;
    ParseToken[] content = new ParseToken[tf.size()];
    int i = 0;
    for (Tensor t : tf)
      content[i++] = tensor2AST(t);
    return new ParseTokenTensorField(tf.getIndices(), tf.getStringName(), content, tf.getArgIndices());
  }
  if (tensor instanceof SimpleTensor) {
    SimpleTensor st = (SimpleTensor) tensor;
    return new ParseTokenSimpleTensor(st.getIndices(), st.getStringName());
  }
  if (tensor instanceof Complex)
    return new ParseTokenNumber((Complex) tensor);
  if (tensor instanceof Expression)
    return new ParseTokenExpression(false, tensor2AST(tensor.get(0)), tensor2AST(tensor.get(1)));
  ParseToken[] content = new ParseToken[tensor.size()];
  int i = 0;
  for (Tensor t : tensor)
    content[i++] = tensor2AST(t);
  if (tensor instanceof ScalarFunction)
    return new ParseTokenScalarFunction(tensor.getClass().getSimpleName(), content);
  return new ParseToken(TokenType.valueOf(tensor.getClass().getSimpleName()), content);
}
cc.redberry.core.parserParseTokenNumber

Javadoc

AST node for Complex.

Most used methods

  • <init>

Popular in Java

  • Start an intent from android
  • findViewById (Activity)
  • getContentResolver (Context)
  • setRequestProperty (URLConnection)
  • Menu (java.awt)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JList (javax.swing)
  • Best plugins for Eclipse
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