Tabnine Logo
ParseToken.toString
Code IndexAdd Tabnine to your IDE (free)

How to use
toString
method
in
cc.redberry.core.parser.ParseToken

Best Java code snippets using cc.redberry.core.parser.ParseToken.toString (Showing top 2 results out of 315)

origin: cc.redberry/core

@Override
public String toString() {
  StringBuilder sb = new StringBuilder();
  sb.append(super.toString()).append('[');
  for (ParseToken node : content)
    sb.append(node.toString()).append(", ");
  sb.deleteCharAt(sb.length() - 1).deleteCharAt(sb.length() - 1).append(']');
  return sb.toString();
}
origin: cc.redberry/core

public String toString(OutputFormat mode) {
  StringBuilder sb = new StringBuilder();
  switch (tokenType) {
    case Trace:
      sb.append("Tr[");
    case Product:
      char operatorChar = mode.is(OutputFormat.LaTeX) ? ' ' : '*';
      for (int i = 0; ; ++i) {
        sb.append(content[i].toString(mode));
        if (i == content.length - 1)
          return tokenType == TokenType.Trace ? sb.append("]").toString() : sb.toString();
        sb.append(operatorChar);
      }
      //throw new RuntimeException();
    case Sum:
      sb.append("(");
      String temp;
      for (int i = 0; ; ++i) {
        temp = content[i].toString(mode);
        if ((temp.charAt(0) == '-' || temp.charAt(0) == '+') && sb.length() != 0)
          sb.deleteCharAt(sb.length() - 1);
        sb.append(content[i].toString(mode));
        if (i == content.length - 1)
          return sb.append(")").toString();
        sb.append('+');
      }
      //throw new RuntimeException();
  }
  throw new RuntimeException("Unsupported token type.");
}
cc.redberry.core.parserParseTokentoString

Popular methods of ParseToken

  • toTensor
    Converts this AST to tensor.
  • <init>
  • contentToTensors
  • equals
  • getIndices
    Returns Indices of the corresponding mathematical expression.
  • setParent

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSupportFragmentManager (FragmentActivity)
  • findViewById (Activity)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Collectors (java.util.stream)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Best IntelliJ plugins
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