btparser/cparser/tests/exp_lex/SHPTemplate.bt

87 lines
1.8 KiB
Plaintext

1:
2:
3:
4:
5:
6:
7:
8:
9: typedef struct point_s { double X ; double Y ; } POINT ;
10:
11: string GetByteSize ( int wordSize )
12: {
13: string s ;
14: SPrintf ( s , "%d" , 2 * wordSize ) ;
15: return s ;
16: }
17:
18: struct ESRI_SHAPE {
19: SetBackColor ( cLtGreen ) ;
20: struct HEADER {
21: BigEndian ( ) ;
22: int fileCode ;
23: int unused [ 5 ] ;
24: int fileLength < read = GetByteSize > ;
25: LittleEndian ( ) ;
26: int version ;
27: enum ShapeEnum {
28: NullShape ,
29: Point ,
30: PolyLine = 3 ,
31: Polygon = 5 ,
32: MultiPoint = 5 ,
33: PointZ = 11 ,
34: PolyLineZ = 13 ,
35: PolygonZ = 15 } shapeType ;
36: double Xmin ;
37: double Ymin ;
38: double Xmax ;
39: double Ymax ;
40: double Zmin ;
41: double Zmax ;
42: double Mmin ;
43: double Mmax ;
44: } header ;
45: SetBackColor ( cLtGray ) ;
46: struct RECORD {
47: BigEndian ( ) ;
48: int recordNumber ;
49: int contentLength < read = GetByteSize > ;
50: LittleEndian ( ) ;
51: enum ShapeTypeEnum {
52: NullShapeType ,
53: PointType ,
54: PolyLineType = 3 ,
55: PolygonType = 5 ,
56: MultiPointType = 8 ,
57: PointZType = 11 ,
58: PolyLineZType = 13 ,
59: PolygonZType = 15 ,
60: MultiPointZType = 18 ,
61: PointMType = 21 ,
62: PolyLineMType = 23 ,
63: PolygonMType = 25 ,
64: MultiPointMType = 28 ,
65: MultiPatchType = 31 } shapeType ;
66: if ( shapeType == 1 )
67: {
68: POINT location ;
69: }
70: else if ( shapeType == 3 )
71: {
72: double box [ 4 ] ;
73: int numParts ;
74: int numPoints ;
75: int parts [ numParts ] ;
76: POINT points [ numPoints ] ;
77: }
78: else if ( shapeType == 5 )
79: {
80: double box [ 4 ] ;
81: int numParts ;
82: int numPoints ;
83: int parts [ numParts ] ;
84: POINT points [ numPoints ] ;
85: }
86: } record [ 10000 ] < optimize = false > ;
87: } esri_shape ; tok_eof