[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Type checking!



Hi!
I writing a Pascal compiler and I came to the point
where I don't know how to process type checking within
expressions.
That is, how do I process type checking on the
following productions taking into account that the
productions above it put all the identifiers in the
symbol table with the appropriate type.

This is the expression :

expression =
  {term} term |
  {plus} expression plus term |
  {minus} expression minus term ;

term =
  {factor} factor |
  {mult} term mult factor |
  {div} term div factor ;

factor =
  {identifier} identifier |
  {array} identifier l_bracket expression_list 
          r_bracket |
  {real} real_literal |
  {integer} integer_literal |
  {char} char_literal;

How do I process the type checking having an instance
of PExpression?

Thanks,
Fidel Viegas.

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com