svghmi/parse_labels.ysl2
branchsvghmi
changeset 3229 c5be4fd425e7
parent 3221 3d307ad803ea
child 3230 95f07764991f
equal deleted inserted replaced
3228:80f96db773bd 3229:c5be4fd425e7
    52                     }
    52                     }
    53                     when "$pathminmaxcount = 2" {
    53                     when "$pathminmaxcount = 2" {
    54                         error > Widget id:«$id» label:«$label» has wrong syntax of path section «$pathminmax»
    54                         error > Widget id:«$id» label:«$label» has wrong syntax of path section «$pathminmax»
    55                     }
    55                     }
    56                 }
    56                 }
    57                 choose {
    57                 if "$indexed_hmitree" choose {
    58                     when "regexp:test($path,'^\.[a-zA-Z0-9_]+$')" {
    58                     when "regexp:test($path,'^\.[a-zA-Z0-9_]+$')" {
    59                         attrib "type" > PAGE_LOCAL
    59                         attrib "type" > PAGE_LOCAL
    60                     }
    60                     }
    61                     when "regexp:test($path,'^[a-zA-Z0-9_]+$')" {
    61                     when "regexp:test($path,'^[a-zA-Z0-9_]+$')" {
    62                         attrib "type" > HMI_LOCAL
    62                         attrib "type" > HMI_LOCAL
    76             }
    76             }
    77         }
    77         }
    78     }
    78     }
    79 }
    79 }
    80 
    80 
       
    81 
       
    82 // Templates to generate label back from parsed tree
       
    83 template "arg", mode="genlabel" > :«@value»
       
    84 
       
    85 template "path", mode="genlabel" {
       
    86     > @«@value»
       
    87     if "string-length(@min)>0 or string-length(@max)>0"  > :«@min»:«@max»
       
    88 }
       
    89 
       
    90 template "widget", mode="genlabel" {
       
    91     > HMI:«@type»
       
    92     apply "arg", mode="genlabel";
       
    93     apply "path", mode="genlabel";
       
    94 }
       
    95