Opened 16 years ago

Closed 16 years ago

#175 closed defect (fixed)

Add sizeof expression to model package

Reported by: ywei Owned by: zirkel
Priority: major Milestone: Release 1.0
Component: model Version: 1.0
Keywords: Cc:

Description

The sizeof expression in the front-end doesn't have a corresponding expression type in the model module. An expression that represents a sizeof expression should be added to the model package.

Change History (3)

comment:1 by Stephen Siegel, 16 years ago

Owner: changed from Stephen Siegel to zirkel
Status: newassigned

comment:2 by Stephen Siegel, 16 years ago

Tim will move AbstractFunction to ModelFactory. An AbstractFunction will no longer belong to a specific model, it will be independent. There will be a method in Model addAbstractFunction, but one AbstractFunction can be added to several models.

Front end will create an abstract function SIZEOF_TYPE from integer to integer. A source code expression of from "sizeof(t)" will be translated as follows: the type t is parsed and created and from that one can get its unique type id, tid. Then create an expression of the form SIZEOF_TYPE(tid).

BTW, there is bug in implementation of newAbstractFunction in model: when a new one is created, it is not added to the table

comment:3 by zirkel, 16 years ago

Resolution: fixed
Status: assignedclosed

The function SIZEOF_TYPE is created in the ModelFactory. SizeOfExpression was removed. The method SizeOfExpression in the ModelFactory takes a TypeIF and returns an EvaluatedFunctionExpression for SIZEOF_TYPE with the ID of the TypeIF as an argument.

Note: See TracTickets for help on using tickets.