github.com/archlabjp/eeslism-go@v0.0.0-20231109122333-4bb7bfcdf292/eeslism/control.go (about)

     1  package eeslism
     2  
     3  type VPtrType rune
     4  
     5  const (
     6  	VAL_CTYPE    VPtrType = 'v' // 設定値 (float64)
     7  	SW_CTYPE     VPtrType = 's' // 切替状態(ControlSWType)
     8  	MAIN_CPTYPE  VPtrType = 'M' // For *MPATH ?
     9  	LOCAL_CPTYPE VPtrType = 'L' // For *PLIST ?
    10  )
    11  
    12  type CONTL struct {
    13  	Type      byte // 条件付き 'c', 無条件 ' '
    14  	Lgv       int  // True:1、False:0
    15  	Cif       *CTLIF
    16  	AndCif    *CTLIF
    17  	AndAndCif *CTLIF
    18  	OrCif     *CTLIF
    19  	Cst       *CTLST
    20  }
    21  
    22  // union V or S alternative
    23  type CTLTYP struct {
    24  	V *float64
    25  	S *ControlSWType
    26  }
    27  
    28  // ControlIf
    29  type CTLIF struct {
    30  	// 演算対象の変数の型
    31  	Type VPtrType // 'v' or 's'
    32  
    33  	// 演算の種類
    34  	Op byte // 比較演算の種類: 'g' for  ">",  'G' for ">=", 'l' for "<",  'L' for "<=", '=' for "==" and 'N' for "!="
    35  
    36  	// 演算対象の変数
    37  	Nlft int    // 演算対象の左変数の数 1 or 2. 1の場合はLft1のみ使用し、2の場合はLft1とLft2の使用する。
    38  	Lft1 CTLTYP // 左辺その1
    39  	Lft2 CTLTYP // 左辺その2
    40  	Rgt  CTLTYP // 右辺
    41  }
    42  
    43  type CTLST struct {
    44  	Type     VPtrType
    45  	PathType VPtrType // 'M', 'L'
    46  	Path     interface{}
    47  	Lft      CTLTYP
    48  	Rgt      CTLTYP
    49  }
    50  
    51  type VPTR struct {
    52  	Type VPtrType
    53  	Ptr  interface{}
    54  }