#include <pac.h>
Inheritance diagram for BasicType:


Public Types | |
| enum | basic_type { name, pactype, ctype, size } |
Public Member Functions | |
| BasicType (basic_type arg_type) | |
| const char * | DataType () |
| void | do_genParseCode (Output *out, Env *env, const DataPtr &data) |
| int | StaticSize (Env *env) const |
| bool | ByteOrderSensitive () const |
Static Public Member Functions | |
| int | lookup_basictype (const char *name) |
Protected Member Functions | |
| void | genDynamicSize (Output *out, Env *env, const DataPtr &data) |
Protected Attributes | |
| basic_type | type |
|
|
Definition at line 421 of file pac.h.
00421 {
00422 # define TYPE_DEF(name, pactype, ctype, size) name,
00423 # include "pac_type.def"
00424 # undef TYPE_DEF
00425 };
00426
00427 static int lookup_basictype(const char* name);
00428
00429 BasicType(basic_type arg_type)
00430 : type(arg_type)
00431 {
00432 if ( type == BasicType::EMPTY )
|
|
|
Definition at line 436 of file pac.h.
00443 { return StaticSize(0) >= 2; }
|
|
|
Implements Type. Definition at line 450 of file pac.h.
00451 : public Type |
|
|
Implements Type. Definition at line 764 of file pac.cc. References ASSERT. Referenced by StaticSize().
00764 {
00765 /* should never be called */
00766 ASSERT(0);
00767 }
|
|
||||||||||||||||
|
Implements Type. Definition at line 769 of file pac.cc.
00771 {
00772 // There is no need to generate the size variable
00773 // out_cc->println("%s = sizeof(%s);", size_var, DataType());
00774
00775 genBoundaryCheck(out_cc, env, data);
00776
00777 switch ( type )
00778 {
00779 case EMPTY:
00780 // do nothing
00781 break;
00782
00783 case INT8:
00784 case UINT8:
00785 out_cc->println("%s = *((%s *) (%s));",
00786 lvalue, DataType(), data.PtrExpr());
00787 break;
00788 case INT16:
00789 case UINT16:
00790 case INT32:
00791 case UINT32:
00792 env->Evaluate(out_cc, &byteorder_id);
00793 out_cc->println("%s = UnMarshall<%s>(%s, %s, %s);",
00794 lvalue,
00795 DataType(),
00796 data.PtrExpr(),
00797 lvalue,
00798 env->RValue(&byteorder_id));
00799 break;
00800 }
00801 }
|
|
||||||||||||||||
|
Implements Type. Definition at line 763 of file pac.cc.
00764 {
00765 /* should never be called */
00766 ASSERT(0);
00767 }
|
|
|
Definition at line 740 of file pac.cc. Referenced by yyparse().
00747 {
|
|
|
Implements Type. Definition at line 769 of file pac.cc. References byteorder_id, DataType(), Env::Evaluate(), Type::genBoundaryCheck(), Output::println(), DataPtr::PtrExpr(), Env::RValue(), and type. |
|
|
Definition at line 453 of file pac.h. Referenced by StaticSize(). |
1.3.5