Class DefParser

java.lang.Object
com.yahoo.config.codegen.DefParser

public class DefParser extends Object
This class generates a tree of CNodes from a .def file.
Author:
gjoranv, hmusum
  • Field Details

    • DEFAULT_PACKAGE_PREFIX

      public static final String DEFAULT_PACKAGE_PREFIX
      See Also:
    • versionPattern

      public static final Pattern versionPattern
    • namespacePattern

      public static final Pattern namespacePattern
    • packagePattern

      public static final Pattern packagePattern
  • Constructor Details

    • DefParser

      public DefParser(String name, Reader defReader)
      Creates a new parser for a .def file with the given name and that can be accessed by the given reader.
      Parameters:
      name - The name of the .def file (not including the '.def' suffix).
      defReader - A reader to the .def file.
  • Method Details

    • getTree

      public InnerCNode getTree() throws CodegenRuntimeException
      Parses the .def file upon the initial call. Subsequent calls returns the result from the initial call.
      Returns:
      A tree of CNodes representing this instance's .def file.
      Throws:
      CodegenRuntimeException - upon errors.
    • getNormalizedDefinition

      public NormalizedDefinition getNormalizedDefinition()
    • dumpTree

      public static void dumpTree(CNode root, String indent)
      For debugging - dump the tree from the given root to System.out.