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

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

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

origin: cc.redberry/core

return new ParseTokenScalarFunction(temp, new ParseToken[]{parser.parse(argument)});
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);
}
origin: cc.redberry/core

@Override
public ParseToken transform(ParseToken node) {
  TokenType type = node.tokenType;
  switch (type) {
    case SimpleTensor:
      ParseTokenSimpleTensor st = (ParseTokenSimpleTensor) node;
      NameAndStructureOfIndices ds = st.getIndicesTypeStructureAndName();
      return new ParseTokenSimpleTensor(transformIndices(st.getIndices(), ds),
          transformer.newName(ds.getName(), ds));
    case TensorField:
      ParseTokenTensorField tf = (ParseTokenTensorField) node;
      ParseToken[] newContent = transformContent(tf.content);
      SimpleIndices[] newArgsIndices = new SimpleIndices[tf.argumentsIndices.length];
      for (int i = newArgsIndices.length - 1; i >= 0; --i)
        newArgsIndices[i] = IndicesFactory.createSimple(null, newContent[i].getIndices());
      NameAndStructureOfIndices dsf = tf.getIndicesTypeStructureAndName();
      return new ParseTokenTensorField(transformIndices(tf.getIndices(), dsf),
          transformer.newName(dsf.getName(), dsf), newContent, newArgsIndices);
    case Number:
      return node;
    case ScalarFunction:
      return new ParseTokenScalarFunction(((ParseTokenScalarFunction) node).function, transformContent(node.content));
    case Expression:
      ParseToken[] nContent = transformContent(node.content);
      return new ParseTokenExpression(((ParseTokenExpression) node).preprocess, nContent[0], nContent[1]);
    default:
      return new ParseToken(node.tokenType, transformContent(node.content));
  }
}
cc.redberry.core.parserParseTokenScalarFunction

Javadoc

AST node for scalar functions.

Most used methods

  • <init>

Popular in Java

  • Reading from database using SQL prepared statement
  • getSystemService (Context)
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • From CI to AI: The AI layer in your organization
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