Well-known text representation in a C program

The well-known text representation of geometry can be incorporated into a C program. The structure for such an implementation is defined below. The notation {}* denotes zero or more repetitions of the tokens within the braces. The braces do not appear in the output token list.
<Geometry Tagged Text> := 
       | <Point Tagged Text> 
       | <LineString Tagged Text>
       | <Polygon Tagged Text>
       | <MultiPoint Tagged  Text>
       | <MultiLineString Tagged Text>
       | <MultiPolygon Tagged Text> 

<Point Tagged Text> := 
      POINT <Point Text> 
<LineString Tagged Text> := 
      LINESTRING <LineString Text> 
<Polygon Tagged Text> := 
      POLYGON <Polygon Text> 
<MultiPoint Tagged Text> :=  
      MULTIPOINT <Multipoint Text> 
<MultiLineString Tagged Text> := 
      MULTILINESTRING <MultiLineString Text> 
<MultiPolygon Tagged Text> := 
      MULTIPOLYGON <MultiPolygon Text> 

<Point Text> := EMPTY 
       |    <Point> 
       | Z  <PointZ> 
       | M  <PointM>
       | ZM <PointZM>


<Point> :=  <x>  <y>   
       <x> := double precision literal
       <y> := double precision literal

<PointZ> :=  <x>  <y>  <z> 
       <x> := double precision literal
       <y> := double precision literal
       <z> := double precision literal

<PointM> :=  <x>  <y>  <m> 
        <x> := double precision literal
        <y> := double precision literal
        <m> := double precision literal


<PointZM> :=  <x>  <y>  <z>  <m> 
        <x> := double precision literal
        <y> := double precision literal
        <z> := double precision literal
        <m> := double precision literal


<LineString Text> := EMPTY 
         |    ( <Point Text >   {,  <Point Text> }*  )
         | Z  ( <PointZ Text >  {,  <PointZ Text> }*  )
         | M  ( <PointM Text >  {,  <PointM Text> }*  )
         | ZM ( <PointZM Text > {,  <PointZM Text> }* )


<Polygon Text> := EMPTY 
       | ( <LineString Text > {,< LineString Text > }*)

<Multipoint Text> := EMPTY 
       | ( <Point Text >   {,  <Point Text > }*  )

<MultiLineString Text> := EMPTY 
       | ( <LineString Text > {,< LineString Text>}*  )

<MultiPolygon Text> := EMPTY 
       | ( < Polygon Text > {,  < Polygon Text > }*  )