Package sc.parser

Class SymbolChoice

    • Field Detail

      • keySize

        public int keySize
      • defaultGenerateValue

        public java.lang.String defaultGenerateValue
        When you have a SymbolChoice that is able to choose from it's values during the generate phase (e.g. the newline at the end of a CSV row), set this to the value to use
    • Constructor Detail

      • SymbolChoice

        public SymbolChoice()
      • SymbolChoice

        public SymbolChoice​(int options,
                            java.lang.String... expectedValues)
      • SymbolChoice

        public SymbolChoice​(java.lang.String... expectedValues)
      • SymbolChoice

        public SymbolChoice​(java.lang.Character... expectedValues)
    • Method Detail

      • addExpectedValue

        public void addExpectedValue​(java.lang.String v)
      • setExpectedValues

        public void setExpectedValues​(java.lang.String[] values)
      • removeExpectedValue

        public void removeExpectedValue​(java.lang.CharSequence v)
      • addExpectedValues

        public void addExpectedValues​(java.lang.String[] values)
      • addExcludedValues

        public void addExcludedValues​(java.lang.String... values)
      • set

        public void set​(java.lang.String... values)
      • add

        public void add​(java.lang.String... values)
      • parseAllChars

        public java.lang.Object parseAllChars​(Parser parser)
      • parse

        public java.lang.Object parse​(Parser parser)
        Description copied from class: Parselet
        The main parse method for the parselet. Use the supplied parser and generate a 'result' either a CharSequence or an IParseNode.
        Specified by:
        parse in class Parselet
      • restore

        public java.lang.Object restore​(Parser parser,
                                        ISemanticNode oldModel,
                                        RestoreCtx rctx,
                                        boolean inherited)
        Description copied from class: Parselet
        The parselet method to re-create the parse node tree given the resulting model.
        Specified by:
        restore in class Parselet
      • saveParse

        public void saveParse​(IParseNode pn,
                              ISemanticNode sn,
                              SaveParseCtx sctx)
        Description copied from class: Parselet
        The parselet method to save parselet ids, offsets, string-lengths etc. The info that when augmented by a de-serialized semantic node quickly reproduces the parse-node tree and attaches it to the model
        Specified by:
        saveParse in class Parselet
      • toHeaderString

        public java.lang.String toHeaderString​(java.util.Map<Parselet,​java.lang.Integer> visited)
        toHeaderString in class Parselet
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • clear

        public void clear()
      • clone

        public java.lang.Object clone()
        clone in class Parselet