Deleted Added
sdiff udiff text old ( 9271:3859f5d4f2c6 ) new ( 9298:9a087e046c58 )
full compact
1# Copyright (c) 2009 The Hewlett-Packard Development Company
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 301 unchanged lines hidden (view full) ---

310 p[4]["enumeration"] = "yes"
311 p[4]["state_decl"] = "yes"
312 p[0] = ast.StateDeclAST(self, p[3], p[4], p[7])
313
314 def p_decl__object(self, p):
315 "decl : type ident pairs SEMI"
316 p[0] = ast.ObjDeclAST(self, p[1], p[2], p[3])
317
318 def p_decl__func_decl(self, p):
319 """decl : void ident '(' params ')' pairs SEMI
320 | type ident '(' params ')' pairs SEMI"""
321 p[0] = ast.FuncDeclAST(self, p[1], p[2], p[4], p[6], None)
322
323 def p_decl__func_def(self, p):
324 """decl : void ident '(' params ')' pairs statements
325 | type ident '(' params ')' pairs statements"""
326 p[0] = ast.FuncDeclAST(self, p[1], p[2], p[4], p[6], p[7])
327
328 # Type fields
329 def p_type_members__list(self, p):
330 "type_members : type_member type_members"
331 p[0] = [ p[1] ] + p[2]
332
333 def p_type_members__empty(self, p):
334 "type_members : empty"
335 p[0] = []
336
337 def p_type_method__0(self, p):
338 "type_member : type_or_void ident '(' types ')' pairs SEMI"
339 p[0] = ast.TypeFieldMethodAST(self, p[1], p[2], p[4], p[6])
340
341 def p_type_member__1(self, p):
342 "type_member : type_or_void ident pairs SEMI"
343 p[0] = ast.TypeFieldMemberAST(self, p[1], p[2], p[3], None)
344
345 def p_type_member__2(self, p):
346 "type_member : type_or_void ident ASSIGN expr SEMI"
347 p[0] = ast.TypeFieldMemberAST(self, p[1], p[2],
348 ast.PairListAST(self), p[4])

--- 349 unchanged lines hidden ---