Record Class CfgBuildOptions

java.lang.Object
java.lang.Record
com.github._1c_syntax.bsl.languageserver.cfg.CfgBuildOptions
Record Components:
loopIterations - строить рёбра повторной итерации циклов (CfgEdgeType.LOOP_ITERATION).
preprocessorConditions - строить вершины условий препроцессора (PreprocessorConditionVertex).
adjacentDeadCode - помечать рёбрами CfgEdgeType.ADJACENT_CODE код, идущий следом за недостижимым.

public record CfgBuildOptions(boolean loopIterations, boolean preprocessorConditions, boolean adjacentDeadCode) extends Record
Набор настроек построения графа потока управления.

Значение неизменяемое и пригодно как часть ключа кэша: графы, построенные с разными настройками, различаются по структуре и не взаимозаменяемы.

Собранный отсюда построитель получает все три настройки явно, поэтому набор задаёт структуру графа целиком, независимо от умолчаний CfgBuildingParseTreeVisitor.

  • Constructor Summary

    Constructors
    Constructor
    Description
    CfgBuildOptions(boolean loopIterations, boolean preprocessorConditions, boolean adjacentDeadCode)
    Creates an instance of a CfgBuildOptions record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the adjacentDeadCode record component.
    Настройки по умолчанию: рёбра итераций циклов и условия препроцессора строятся, соседний с недостижимым код не помечается.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the loopIterations record component.
    boolean
    Returns the value of the preprocessorConditions record component.
    final String
    Returns a string representation of this record class.
    withAdjacentDeadCode(boolean enable)
    Копия набора с изменённой пометкой кода, соседнего с недостижимым.
    withLoopIterations(boolean enable)
    Копия набора с изменённым построением рёбер повторной итерации циклов.
    Копия набора с изменённым построением вершин условий препроцессора.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CfgBuildOptions

      public CfgBuildOptions(boolean loopIterations, boolean preprocessorConditions, boolean adjacentDeadCode)
      Creates an instance of a CfgBuildOptions record class.
      Parameters:
      loopIterations - the value for the loopIterations record component
      preprocessorConditions - the value for the preprocessorConditions record component
      adjacentDeadCode - the value for the adjacentDeadCode record component
  • Method Details

    • defaults

      public static CfgBuildOptions defaults()
      Настройки по умолчанию: рёбра итераций циклов и условия препроцессора строятся, соседний с недостижимым код не помечается.
      Returns:
      набор настроек по умолчанию.
    • withLoopIterations

      public CfgBuildOptions withLoopIterations(boolean enable)
      Копия набора с изменённым построением рёбер повторной итерации циклов.
      Parameters:
      enable - строить ли рёбра повторной итерации.
      Returns:
      новый набор настроек.
    • withPreprocessorConditions

      public CfgBuildOptions withPreprocessorConditions(boolean enable)
      Копия набора с изменённым построением вершин условий препроцессора.
      Parameters:
      enable - строить ли вершины условий препроцессора.
      Returns:
      новый набор настроек.
    • withAdjacentDeadCode

      public CfgBuildOptions withAdjacentDeadCode(boolean enable)
      Копия набора с изменённой пометкой кода, соседнего с недостижимым.
      Parameters:
      enable - помечать ли соседний код.
      Returns:
      новый набор настроек.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • loopIterations

      public boolean loopIterations()
      Returns the value of the loopIterations record component.
      Returns:
      the value of the loopIterations record component
    • preprocessorConditions

      public boolean preprocessorConditions()
      Returns the value of the preprocessorConditions record component.
      Returns:
      the value of the preprocessorConditions record component
    • adjacentDeadCode

      public boolean adjacentDeadCode()
      Returns the value of the adjacentDeadCode record component.
      Returns:
      the value of the adjacentDeadCode record component