|type or identifier fundamental parsing issue - Need help from parsing email@example.com (AD) (2012-07-03)|
|Re: type or identifier fundamental parsing issue - Need help from pars firstname.lastname@example.org (George Neuner) (2012-07-04)|
|Re: type or identifier fundamental parsing issue - Need help from pars DrDiettrich1@aol.com (Hans-Peter Diettrich) (2012-07-04)|
|Re: type or identifier fundamental parsing issue - Need help from pars email@example.com (2012-07-11)|
|Re: C arcana, was type or identifier fundamental parsing issue - Need firstname.lastname@example.org (christian.bau) (2012-07-12)|
|DKIM-Signature:||v=1; a=rsa-sha256; c=simple; d=iecc.com; h=cc:from:subject:date:sender:message-id:mime-version:content-type:content-transfer-encoding:vbr-info; s=1857f.4ff3ab3d.k1207; email@example.com; bh=Qu9c50CjGMWPrARBy+zRL0o7GRDh/0Yn4yLxBZYKZgU=; b=RNyZWH+90Iy6f5UVAGVYF7H8/beTAv2IUsk5jZlrFAhU9jT0Rm2qMzwR7JgWID2GwF9ZoymbO2W7cnEzZJZfC3Zqvy16Ib2pjoneolN52XHfj54eupSI2PNZ8y6nhUH38lZz7e0hMU5/LExtrbJV+iX/j8ScoHG3NDQ1hsUhd+o=|
|VBR-Info:||md=iecc.com; mc=all; mv=dwl.spamhaus.org|
|Date:||Tue, 3 Jul 2012 11:30:48 -0700 (PDT)|
|Keywords:||parse, types, design, question|
|Posted-Date:||03 Jul 2012 22:32:28 EDT|
I am dealing with a programming langauge that supports something like
sizeof(<typename>) as well as sizeof(<variable-name>) expression.
For parsing such a construct, one would need a parser/yacc rule somewhat like
SIZEOF_KEYWORD '(' IDENTIFIER ')'
The fundamemtal problem in the rules of the language (that I am dealing with)
is that its lookup/resolution rule *doesn't* allow me to check in symbol table
if that 'IDENTIFIER' is a type or non-type variable. Problem is, this language
supports certain constructs which can potentially/later make such early
lookup/resolution decisions wrong. In short, name resolutions in this langauge
(as per the langauge definition) can only be initiated after the entire source
code has been completely parsed/seen.
Given this restriction, I will probably have to delay/defer the decision of,
whether we saw a 'type' or a non-type variable (with the 'sizeof' operator) to
"semantic check phase".
On the other hand, some people/experts believe that such decisions of whether
something is a type or non-type idernfier has to be frozen/finished during
parsing and *SHOULD NOT* be deferred/delayed to 'semantic check phase'.
I am not an expert compiler researcher/scientist, so am seeking some opinion
here, if you happen to have a sound knowledge on this issue.
Return to the
Search the comp.compilers archives again.