###############################################################################
# Copyright (c) 2000-2021 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
#
# Contributors:
#   Balasko, Jeno
#   Beres, Szabolcs
#
###############################################################################


[DEFINE]
#  _f means "faulty"

#DEF_1_f1 := \"asdf\"  //faulty
#DEF_1_f2 := ""asdf"" //faulty
#DEF_2 := "a""b"
// Escape characters
DEF_1:="a"
DEF_2 := "abr"${DEF_1}"kadabra"

num1 := 1 
num2:=2

//==== Structured ====
// multiline stuff

/*
DEF_11 := 1
DEF_1_1 := { i := ${DEF_11}}     
*/

DEF_3_1 := { f1 := { f2 := { f3:="a"}}}
DEF_3_2 := { 
 f1 := { 
   f2 :=/*anyth{{ing*/{ 
f3:="a"}}}   //   =>   {f1:={f2:={f3:="a"}}}

DEF_3_3 := { f1 := { f2 := { f3:= \"${DEF_2}\" }}}

/*
DEF_4_f := {asdf#{{
 
     } 
*/
DEF_4 := { "asdf"  #{{
}
 
a := 7.2
b := 2.0 
DEF_5_1 := { { ${a} }}     
DEF_5_2 := { { ${a}/${b} }} //???

DEF_20 := 1     // 1 as charstring by default
DEF_21 := "1"   // 1 as charstring

DEF_22 := "\"1\"" // "1" as charstring
DEF_23 := a     // a as charstring
DEF_24 := "a"   // a as charstring
DEF_25 := "\"a\"" // "a" as charstring

DEF_26 := { f3 := "a"}


//DEF_50 := { f1 := { f2 := { f3 := a}}}   //   => DEF_37 := { f1 := a}

DEF_S_f := {a}
DEF_S2_f := {\a}

DEF_30 := { f3 := \"${DEF_20}\" } //   => DEF_30 := { f3 := "1"}
DEF_31 := { f3 := \"${DEF_21}\"} //   => DEF_31 := { f3 := "1"}
DEF_32 := { f3 := ${DEF_22}} //  => DEF_32 := { f3 := "1"}
DEF_33 := { f3 := \"${DEF_23}\"} //  => DEF_33 := { f3 := "a"}
DEF_34 := { f3 := \"${DEF_24}\"} //    => DEF_34 := { f3 := "a"}


DEF_35 := { f3 := \"${DEF_24}\"} //    => DEF_35 := { f3 := "a"} //FIXME!!!

#  => DEF_35 := { f1 := "a"}
DEF_36 := { f3 := ${DEF_25}}   //  => DEF_36 := { f3 := "a"}
DEF_37 := { f3 := \"a\" }   //   => DEF_37 := { f3 := "a"}
DEF_38 := { f3 := "a"}  //  => DEF_38 := { f3 := "a"}
DEF_39 := { f3 := "${DEF_20}"} //=> DEF_39 :={ f3 := "${DEF_20}"

DEF_40 := ""

DEF_41 := {}
DEF_42 := { }
DEF_43 := {
}

DEF_44 := {{},{},{}, { } ,{ } }

DEF_50 := { { ${DEF_40} },${DEF_41},${DEF_42},${DEF_43} } 

DEF_E1 := {
  i:=0,
 f:=3.14,
bs:='0011'B,
hs:='123AF'H,
os:='0123AF'O,
cs:="hello"
}

DEF_BS:="\'0011\'B"
DEF_HS:="\'123AF\'H"
DEF_OS:="\'0123AF\'O"
DEF_CS:="\""${DEF_2}"\""
#DEF_CS:=""${DEF_2}""  <- not ok

DEF_E2 := {
  i:=${num1},
  f:=${a},
  bs:= ${DEF_BS},
  hs:= ${DEF_HS},
  os:= ${DEF_OS},
  cs:= ${DEF_CS}
}

DEF_E3 := {
  i:=${num1},
  f:=${a},
  bs:= ${DEF_BS},
  hs:= ${DEF_HS},
  os:= ${DEF_OS},
  cs:= "\""${DEF_2}"\"" 
}


DEF_E4 := {
  i:=${num1},
  f:=${a},
  bs:= ${DEF_BS},
  hs:= ${DEF_HS},
  os:= ${DEF_OS},
  cs:= \"${DEF_2}\" 
}


//Union:
DEF_U_i := { i:= ${num1} }
DEF_U_f := { f:= ${a} }
DEF_U_bs := { bs:= ${DEF_BS} }
DEF_U_hs := { hs:= ${DEF_HS} }
DEF_U_os := { os:= ${DEF_OS} }
DEF_U_cs1 := { cs:= \"${DEF_2}\" }
DEF_U_cs2 := { cs:=  ${DEF_CS} }
DEF_CR1 := { 
      rf_PowerCapability := '000'B, // '000'B class1 (for GSM+DCS+PCS)
      a5_1 := '0'B, //encryption algorithm A5/1 available ('1'B) or not ('0'B)
      esind := '0'B,//controlled early classmark sending implemented ('1'B) or not ('0'B)
      revisionLevel := '01'B,      //  '00'B reserved for phase1 (GSM+DCS)
      spare1_1 := '0'B,
      fc := '0'B,          //  MS' support of E/R_GSM ('1'B) or not ('0'B)
      vgcs := '0'B, // VGCS capability or notification wanted ('1'B) or not ('0'B)
      vbs := '0'B,  // VBS capability or notification wanted ('1'B) or not ('0'B)
      sm_Capability := '1'B, // SM capbility present ('1'B) or not ('0'B) 
      ss_ScreenIndicator := '01'B, //  '00'B default value of phase1 (GSM+DCS)
      ps_Capability := '0'B,      // ignored, if received
      spare2_1 := '0'B,
      classmarkInformationType2_oct5 :=
      { a5_2 := '0'B,
        a5_3 := '0'B,
        cmsp := '0'B,
        solsa := '0'B,
        ucs2 := '0'B,
        lcsvacap := '1'B,
        spare := '0'B,
        cm3 := '1'B
      }
}


DEF_CIT := { a5_2 := '0'B,
        a5_3 := '0'B,
        cmsp := '0'B,
        solsa := '0'B,
        ucs2 := '0'B,
        lcsvacap := '1'B,
        spare := '0'B,
        cm3 := '1'B
}

DEF_CR2 := { 
      rf_PowerCapability := '000'B, // '000'B class1 (for GSM+DCS+PCS)
      a5_1 := '0'B, //encryption algorithm A5/1 available ('1'B) or not ('0'B)
      esind := '0'B,//controlled early classmark sending implemented ('1'B) or not ('0'B)
      revisionLevel := '01'B,      //  '00'B reserved for phase1 (GSM+DCS)
      spare1_1 := '0'B,
      fc := '0'B,          //  MS' support of E/R_GSM ('1'B) or not ('0'B)
      vgcs := '0'B, // VGCS capability or notification wanted ('1'B) or not ('0'B)
      vbs := '0'B,  // VBS capability or notification wanted ('1'B) or not ('0'B)
      sm_Capability := '1'B, // SM capbility present ('1'B) or not ('0'B) 
      ss_ScreenIndicator := '01'B, //  '00'B default value of phase1 (GSM+DCS)
      ps_Capability := '0'B,      // ignored, if received
      spare2_1 := '0'B,
      classmarkInformationType2_oct5 := ${DEF_CIT}
}

//DEF_BS2 := "\'000\'B"
DEF_BS2 := "'000'B"
DEF_BS3 := "'0'B"
DEF_BS4 := "'01'B"

DEF_CR3 := { 
      rf_PowerCapability := ${DEF_BS2}, // '000'B class1 (for GSM+DCS+PCS)
      a5_1 :=  ${DEF_BS3}, //encryption algorithm A5/1 available ('1'B) or not ('0'B)
      esind := ${DEF_BS3} ,//controlled early classmark sending implemented ('1'B) or not ('0'B)
      revisionLevel :=${DEF_BS4},      //  '00'B reserved for phase1 (GSM+DCS)
      spare1_1:=${DEF_BS3},
      fc :=${DEF_BS3}   ,          //  MS' support of E/R_GSM ('1'B) or not ('0'B)
      vgcs :=  ${DEF_BS3}, // VGCS capability or notification wanted ('1'B) or not ('0'B)
      vbs := '0'B,  // VBS capability or notification wanted ('1'B) or not ('0'B)
      sm_Capability := '1'B, // SM capbility present ('1'B) or not ('0'B) 
      ss_ScreenIndicator := '01'B, //  '00'B default value of phase1 (GSM+DCS)
      ps_Capability := '0'B,      // ignored, if received
      spare2_1 := '0'B,
      classmarkInformationType2_oct5 := ${DEF_CIT}
}

[MODULE_PARAMETERS]
tsp_1 := ${DEF_1}
tsp_2 := ${DEF_2}
tsp_3_1 := ${DEF_3_1}
tsp_3_2 := ${DEF_3_2}
tsp_3_3 := ${DEF_3_3}
tsp_4   := ${DEF_4}  //"asdf"
tsp_5_1 := ${DEF_5_1}
tsp_5_2 := ${DEF_5_2}
tsp_30 :=${DEF_30}
tsp_31 := ${DEF_31}
tsp_32 := ${DEF_32}
tsp_33 := ${DEF_33}
tsp_34 := ${DEF_34}
tsp_35 := ${DEF_35}
tsp_36 := ${DEF_36}
tsp_37 := ${DEF_37}
tsp_38 := ${DEF_38}
tsp_39 := ${DEF_39}
tsp_41 := ${DEF_41}
tsp_42 := ${DEF_42}
tsp_43 := ${DEF_43}
tsp_44 := ${DEF_44}
tsp_50 :=${ DEF_50 }

//records:
structured.tsp_e1 := ${DEF_E1}
structured.tsp_e2 := ${DEF_E2}
structured.tsp_e3 := ${DEF_E3}
structured.tsp_e4 := ${DEF_E4}

//unions:
tsp_U_i :=  ${DEF_U_i}
tsp_U_f :=  ${DEF_U_f}
tsp_U_bs :=  ${DEF_U_bs}
tsp_U_hs :=  ${DEF_U_hs}
tsp_U_os :=  ${DEF_U_os}
tsp_U_cs1 :=  ${DEF_U_cs1}
tsp_U_cs2 :=  ${DEF_U_cs2}
tsp_CR1:= ${DEF_CR1}
tsp_CR2:= ${DEF_CR2}
tsp_CR3:= ${DEF_CR3}

[EXECUTE]
structured.control
