Deleted Added
sdiff udiff text old ( 7567:238f99c9f441 ) new ( 7839:9e556fb25900 )
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

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

160 'stall_and_wait' : 'STALL_AND_WAIT',
161 'wake_up_dependents' : 'WAKE_UP_DEPENDENTS',
162 'enqueue' : 'ENQUEUE',
163 'copy_head' : 'COPY_HEAD',
164 'check_allocate' : 'CHECK_ALLOCATE',
165 'check_stop_slots' : 'CHECK_STOP_SLOTS',
166 'static_cast' : 'STATIC_CAST',
167 'if' : 'IF',
168 'else' : 'ELSE',
169 'return' : 'RETURN',
170 'THIS' : 'THIS',
171 'CHIP' : 'CHIP',
172 'void' : 'VOID',
173 'new' : 'NEW',
174 }
175
176 literals = ':[]{}(),='
177
178 tokens = [ 'EQ', 'NE', 'LT', 'GT', 'LE', 'GE',
179 'LEFTSHIFT', 'RIGHTSHIFT',
180 'NOT', 'AND', 'OR',
181 'PLUS', 'DASH', 'STAR', 'SLASH',

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

571 p[0] = ast.CheckAllocateStatementAST(self, p[3])
572
573 def p_statement__check_stop(self, p):
574 "statement : CHECK_STOP_SLOTS '(' var ',' STRING ',' STRING ')' SEMI"
575 p[0] = ast.CheckStopStatementAST(self, p[3], p[5], p[7])
576
577 def p_statement__static_cast(self, p):
578 "aexpr : STATIC_CAST '(' type ',' expr ')'"
579 p[0] = ast.StaticCastAST(self, p[3], p[5])
580
581 def p_statement__return(self, p):
582 "statement : RETURN expr SEMI"
583 p[0] = ast.ReturnStatementAST(self, p[2])
584
585 def p_statement__if(self, p):
586 "statement : if_statement"
587 p[0] = p[1]
588

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

598 "if_statement : IF '(' expr ')' statements ELSE if_statement"
599 p[0] = ast.IfStatementAST(self, p[3], p[5],
600 ast.StatementListAST(self, p[7]))
601
602 def p_expr__var(self, p):
603 "aexpr : var"
604 p[0] = p[1]
605
606 def p_expr__literal(self, p):
607 "aexpr : literal"
608 p[0] = p[1]
609
610 def p_expr__enumeration(self, p):
611 "aexpr : enumeration"
612 p[0] = p[1]
613
614 def p_expr__func_call(self, p):
615 "aexpr : ident '(' exprs ')'"
616 p[0] = ast.FuncCallExprAST(self, p[1], p[3])
617
618 def p_expr__new(self, p):
619 "aexpr : NEW type"
620 p[0] = ast.NewExprAST(self, p[2])
621
622 # globally access a local chip component and call a method
623 def p_expr__local_chip_method(self, p):
624 "aexpr : THIS DOT var '[' expr ']' DOT var DOT ident '(' exprs ')'"
625 p[0] = ast.LocalChipMethodAST(self, p[3], p[5], p[8], p[10], p[12])
626
627 # globally access a local chip component and access a data member
628 def p_expr__local_chip_member(self, p):
629 "aexpr : THIS DOT var '[' expr ']' DOT var DOT field"

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

682 """expr : NOT expr
683 | DASH expr %prec UMINUS"""
684 p[0] = PrefixOperatorExpr(p[1], p[2])
685
686 def p_expr__parens(self, p):
687 "aexpr : '(' expr ')'"
688 p[0] = p[2]
689
690 def p_literal__string(self, p):
691 "literal : STRING"
692 p[0] = ast.LiteralExprAST(self, p[1], "std::string")
693
694 def p_literal__number(self, p):
695 "literal : NUMBER"
696 p[0] = ast.LiteralExprAST(self, p[1], "int")
697

--- 19 unchanged lines hidden ---