plcopen/variables_infos.ysl2
changeset 1368 e567e4bee11f
parent 1361 7158aa054226
child 1936 b85b13b1c2ec
equal deleted inserted replaced
1367:324767a092dc 1368:e567e4bee11f
     8     param "tree";
     8     param "tree";
     9     
     9     
    10     template "text()";
    10     template "text()";
    11     
    11     
    12     variable "project" {
    12     variable "project" {
    13         choose {
    13         copy "document('project')/project/*";
    14             when "$tree='True'" {
       
    15                 copy "document('project')/project/*";
       
    16             }
       
    17         }
       
    18     }
    14     }
    19     
    15     
    20     variable "stdlib" {
    16     variable "stdlib" {
    21         choose {
    17         copy "document('stdlib')/stdlib/*";
    22             when "$tree='True'" {
       
    23                 copy "document('stdlib')/stdlib/*";
       
    24             }
       
    25         }
       
    26     }
    18     }
    27     variable "extensions" {
    19     variable "extensions" {
    28         choose {
    20         copy "document('extensions')/extensions/*";
    29             when "$tree='True'" {
       
    30                 copy "document('extensions')/extensions/*";
       
    31             }
       
    32         }
       
    33     }
    21     }
    34     
    22     
    35     template "ppx:configuration" {
    23     template "ppx:configuration" {
    36         apply "ppx:globalVars";
    24         apply "ppx:globalVars";
    37     }
    25     }
   122         apply "ppx:interface/*[self::ppx:inputVars or self::ppx:inOutVars or self::ppx:outputVars]/ppx:variable", mode="var_type";
   110         apply "ppx:interface/*[self::ppx:inputVars or self::ppx:inOutVars or self::ppx:outputVars]/ppx:variable", mode="var_type";
   123     }
   111     }
   124     
   112     
   125     template "ppx:variable", mode="var_type" {
   113     template "ppx:variable", mode="var_type" {
   126         variable "name" > «@name»
   114         variable "name" > «@name»
   127         value "ns:AddTree($name)";
   115         value "ns:AddTree()";
   128         apply "ppx:type", mode="var_type";
   116         apply "ppx:type", mode="var_type";
   129         value "ns:AddVarToTree($name)";
   117         value "ns:AddVarToTree($name)";
   130     }
   118     }
   131     
   119     
   132     template "ppx:dataType", mode="var_type" {
   120     template "ppx:dataType", mode="var_type" {
   153     }
   141     }
   154      
   142      
   155     template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:array", mode="var_type" {
   143     template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:array", mode="var_type" {
   156         apply "ppx:baseType", mode="var_type";
   144         apply "ppx:baseType", mode="var_type";
   157         foreach "ppx:dimension" {
   145         foreach "ppx:dimension" {
   158             value "ns:AddDimension(@lower, @upper)";
   146             variable "lower" > «@lower»
       
   147             variable "upper" > «@upper»
       
   148             value "ns:AddDimension($lower, $upper)";
   159         }
   149         }
   160     }
   150     }
   161     
   151     
   162     template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:string", mode="var_type" {
   152     template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:string", mode="var_type" {
   163         variable "name" > STRING
   153         variable "name" > STRING
   173         variable "name" > «local-name()»
   163         variable "name" > «local-name()»
   174         value "ns:SetType($name)";
   164         value "ns:SetType($name)";
   175     }
   165     }
   176     
   166     
   177     template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived", mode="var_edit" {
   167     template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived", mode="var_edit" {
   178         variable "type_name", "@name";
   168         variable "type_name" > «@name»
   179         variable "pou_infos" {
   169         variable "pou_infos" {
   180             copy """exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
   170             copy """exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
   181                     exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
   171                     exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
   182                     exsl:node-set($extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name]""";
   172                     exsl:node-set($extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name]""";
   183         }
   173         }