Ignore:
Timestamp:
2020-01-13T21:45:14+01:00 (5 years ago)
Author:
simon04
Message:

JOSM/comfort0: parse tags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/comfort0/src/net/simon04/comfort0/level0l/Level0LParser.jj

    r35283 r35284  
    1717<DEFAULT> //HEADER
    1818TOKEN: {
    19     <H_EOL: ("\n" | "\r" | "\r\n") >
     19    <H_EOL: ("\n" | "\r" | "\r\n") > : DATA
    2020    | <H_ID: (["0"-"9"])+ >
    2121    | <NODE: "node" >
     
    3939TOKEN: {
    4040    <D_EOL: ("\n" | "\r" | "\r\n") >
     41    | <D_SPACE: " " >
    4142    | <D_ID: (["0"-"9"])+ >
    4243    | <WY: "wy" >
    4344    | <ND: "nd" >
    4445    | <REL: "rel" >
    45     | <EQ: "=" >
     46    | <EQ: "=" > : VALUE
    4647    | <IDENT: ["a"-"z", "A"-"Z", "_"] (["a"-"z", "A"-"Z", "_", "-", "0"-"9"])* >
     48}
     49
     50<VALUE>
     51TOKEN: {
     52    <V_EOL: ("\n" | "\r" | "\r\n") > : DATA
     53    | <TEXT: (~["\n", "\r"])+ >
    4754}
    4855
     
    6370    { r.setCoor(new LatLon(Double.parseDouble(lat.image), Double.parseDouble(lon.image))); }
    6471    (<COMMENT_START> | <H_EOL>)
     72    tags(r)
    6573    { return r; }
    6674}
     75
     76void tags(PrimitiveData r):
     77{}
     78{
     79    ( tag(r) )*
     80}
     81
     82void tag(PrimitiveData r):
     83{
     84    Token k, v;
     85}
     86{
     87    <D_SPACE> <D_SPACE>
     88    k=<IDENT>
     89    ( <D_SPACE> ) *
     90    <EQ>
     91    v=<TEXT>
     92    <V_EOL>
     93    { r.put(k.image.trim(), v.image.trim()); }
     94}
Note: See TracChangeset for help on using the changeset viewer.