Mercurial > lcfOS
comparison python/c3/parser.py @ 226:240111e0456f
Work on named types
author | Windel Bouwman |
---|---|
date | Fri, 12 Jul 2013 17:25:31 +0200 |
parents | 1c7364bd74c7 |
children | 82dfe6a32717 |
comparison
equal
deleted
inserted
replaced
225:1c7364bd74c7 | 226:240111e0456f |
---|---|
87 self.Consume('struct') | 87 self.Consume('struct') |
88 self.Consume('{') | 88 self.Consume('{') |
89 mems = [] | 89 mems = [] |
90 while self.Peak != '}': | 90 while self.Peak != '}': |
91 mem_t = self.parseTypeSpec() | 91 mem_t = self.parseTypeSpec() |
92 mem_n = self.Consume('ID') | 92 mem_n = self.Consume('ID').val |
93 mems.append((mem_t, mem_n)) | 93 mems.append((mem_t, mem_n)) |
94 while self.hasConsumed(','): | 94 while self.hasConsumed(','): |
95 mem_n = self.Consume('ID') | 95 mem_n = self.Consume('ID').val |
96 mems.append((mem_t, mem_n)) | 96 mems.append((mem_t, mem_n)) |
97 self.Consume(';') | 97 self.Consume(';') |
98 self.Consume('}') | 98 self.Consume('}') |
99 theT = astnodes.StructureType(mems) | 99 theT = astnodes.StructureType(mems) |
100 else: | 100 else: |