Class ASTBase<SELF extends ASTBase<SELF>>

java.lang.Object
xyz.cofe.cxel.ast.ASTBase<SELF>
Type Parameters:
SELF - Производный тип
All Implemented Interfaces:
xyz.cofe.collection.ImTree<AST>, xyz.cofe.collection.ImTreeWalk<AST>, AST, xyz.cofe.text.tparse.Tok<xyz.cofe.text.tparse.TPointer>
Direct Known Subclasses:
BooleanAST, CallAST, IfAST, IndexAST, KeywordAST, ListAST, MapAST, MapEntryAST, NullAST, NumberAST, OpAST, ParenthesAST, PropertyAST, StringAST, VarRefAST

public abstract class ASTBase<SELF extends ASTBase<SELF>>
extends java.lang.Object
implements AST
Базовый класс для AST выражений
  • Nested Class Summary

    Nested classes/interfaces inherited from interface xyz.cofe.collection.ImTreeWalk

    xyz.cofe.collection.ImTreeWalk.Walk<A extends xyz.cofe.collection.ImTree<? extends A>>
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected xyz.cofe.text.tparse.TPointer begin  
    protected xyz.cofe.text.tparse.TPointer end  
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected ASTBase()
    Конструктор по умолчанию
    protected ASTBase​(SELF sample)
    Уонструктор копирования
      ASTBase​(xyz.cofe.text.tparse.TPointer begin, xyz.cofe.text.tparse.TPointer end)
    Конструктор
  • Method Summary

    Modifier and Type Method Description
    xyz.cofe.text.tparse.TPointer begin()
    Возвращает начало токена
    protected AST[] children​(boolean omitNull, AST... children)
    Возвращает указанный массив
    protected AST[] children​(AST... children)
    Возвращает указанный массив
    abstract SELF clone()
    Клонирование AST узла
    protected SELF cloneAndConf​(java.util.function.Consumer<SELF> conf)
    Клонирование с настройкой клона
    protected AST[] emptyChildren()
    Возвращает пустой массив
    xyz.cofe.text.tparse.TPointer end()
    Возвращает указатель на конец токена

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface xyz.cofe.cxel.ast.AST

    children, nodes

    Methods inherited from interface xyz.cofe.collection.ImTreeWalk

    walk
  • Field Details

    • begin

      protected xyz.cofe.text.tparse.TPointer begin
    • end

      protected xyz.cofe.text.tparse.TPointer end
  • Constructor Details

    • ASTBase

      protected ASTBase()
      Конструктор по умолчанию
    • ASTBase

      protected ASTBase​(SELF sample)
      Уонструктор копирования
      Parameters:
      sample - образец для копирования
    • ASTBase

      public ASTBase​(xyz.cofe.text.tparse.TPointer begin, xyz.cofe.text.tparse.TPointer end)
      Конструктор
      Parameters:
      begin - начало AST узла
      end - конец AST узла
  • Method Details

    • clone

      public abstract SELF clone()
      Клонирование AST узла
      Overrides:
      clone in class java.lang.Object
      Returns:
      клон
    • cloneAndConf

      protected SELF cloneAndConf​(java.util.function.Consumer<SELF> conf)
      Клонирование с настройкой клона
      Parameters:
      conf - конфигурация
      Returns:
      клон
    • begin

      public xyz.cofe.text.tparse.TPointer begin()
      Возвращает начало токена
      Specified by:
      begin in interface xyz.cofe.text.tparse.Tok<SELF extends ASTBase<SELF>>
      Returns:
      указатель на начало (включительно)
    • end

      public xyz.cofe.text.tparse.TPointer end()
      Возвращает указатель на конец токена
      Specified by:
      end in interface xyz.cofe.text.tparse.Tok<SELF extends ASTBase<SELF>>
      Returns:
      Указатель на конец токена (включительно)
    • emptyChildren

      protected AST[] emptyChildren()
      Возвращает пустой массив
      Returns:
      пустой массив
    • children

      protected AST[] children​(boolean omitNull, AST... children)
      Возвращает указанный массив
      Parameters:
      omitNull - false - возвращать массив как есть, true - возвращать массив без null ссылок
      children - массив
      Returns:
      переданный массив
    • children

      protected AST[] children​(AST... children)
      Возвращает указанный массив
      Parameters:
      children - массив
      Returns:
      переданный массив