Search the web
Sign In
New User? Sign Up
compilers101 · Compilers 101
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 96 - 125 of 1320   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Simplify | Expand   (Group by Topic) Author Sort by Date ^
96
Hello, I've been having a tough time getting C declarators to parse properly. I'm trying to construct a list of declarators in a type structure and although I...
Bart
bart_trzynad...
Offline Send Email
Jan 3, 2003
4:38 am
97
... An alternative suggestion: parse it with a simple left to right grammar, and treat everything as an operator and apply operator precedence rules? highest...
Graham Toal
graham_toal
Offline Send Email
Jan 3, 2003
6:01 am
98
... Parse the entire language that way? ... How to parenthesis fit into this picture? I've found that parsing declarations with only involve * and [] to be ...
Bart
bart_trzynad...
Offline Send Email
Jan 3, 2003
6:40 am
99
... I'm pretty sure x is right but y and z are both wrong. AIUI, indexing has higher precedence than indirecting, i.e. if "*x[4]" is an int, then x is not a...
Rainer Thonnes
rainer@...
Send Email
Jan 3, 2003
11:28 am
100
... Why not? :-) ... I think this is where the BCM lies. If you start from the premise (which I believe to be false) that precedence at the outer level is...
Rainer Thonnes
rainer@...
Send Email
Jan 3, 2003
1:24 pm
101
... x is right, as you say, and this can be quickly verified by thinking of argv. I use "char **argv" in my main() declarations, but *argv[] is valid too. I'm...
Bart
bart_trzynad...
Offline Send Email
Jan 4, 2003
1:49 am
102
... I'd have to write a parser of my own completely from scratch. I could also just do a top-down hand-written parser a la LCC (and most commercial compilers?)...
Bart
bart_trzynad...
Offline Send Email
Jan 4, 2003
2:40 am
103
... with and ... elsewhere in ... odd, but I ... to see ... I have to admit I'd never seen or used that construct either. I suspect the following program might...
Graham Toal <gtoal@...>
graham_toal
Offline Send Email
Jan 4, 2003
9:11 am
104
... That's the exact same example I used in reaching my conclusion. ... Don't bother. I forgot to think inside-out here. You were right. ... Um, no, sorry...
Rainer Thonnes
rainer@...
Send Email
Jan 4, 2003
11:13 am
105
... I didn't express that very well. Replace the last sentence with: Then, working in, the "y" in (*y) must be a pointer to what (*y) is....
Rainer Thonnes
rainer@...
Send Email
Jan 4, 2003
12:16 pm
106
... What he said. Just keep the tree. We haven't discussed casts yet. casts have a pretty obvious interpretation in our data structure: cast / \ type expr ...
Graham Toal
graham_toal
Offline Send Email
Jan 4, 2003
3:28 pm
107
You're probably aware of this, but just to get it in writing... int a[10][10] is 10*10*sizeof(int) bytes. It's a 2-d array and there are no pointers involved,...
Graham Toal
graham_toal
Offline Send Email
Jan 4, 2003
3:43 pm
108
... There would have to be, if there are still any compilers around which use this technique. Nobody would write the parse tables by hand. The Edinburgh...
Rainer Thonnes
rainer@...
Send Email
Jan 4, 2003
4:13 pm
109
... the ... grammar ... which ... I think the sort of representation Rainer is talking about is an extended phrase syntax such as this (I'm translating...
Graham Toal <gtoal@...>
graham_toal
Offline Send Email
Jan 4, 2003
6:08 pm
110
... Rainer corrected the error above, and I'd like to repeat what he said with a slightly different take: any time you have a bracketed expression, ask how you...
Graham Toal <gtoal@...>
graham_toal
Offline Send Email
Jan 4, 2003
10:20 pm
111
Hello everyone, Well, I'm back from Maui (with the tan to prove it ;))! It was wonderful, as expected, but now it's time for me to make up for lost coding...
Bart
bart_trzynad...
Offline Send Email
Jan 12, 2003
8:59 pm
112
... If you remain consistent with my method, the logic remains the same until you decide to remove the unnecessary bracketing. *(*X)[10] would be equivalent to...
Bart
bart_trzynad...
Offline Send Email
Jan 12, 2003
9:52 pm
113
... Interesting program. I've only looked at this man page but I'm going to have to get this program running here so I can play with it. ... This is how it...
Bart
bart_trzynad...
Offline Send Email
Jan 12, 2003
10:20 pm
114
... In which situations (if any) will the compiler reject an explicit cast? If it only happens in some really obvious case, couldn't the cast be completely...
Bart
bart_trzynad...
Offline Send Email
Jan 12, 2003
10:27 pm
115
... I've been waiting for you. ... Well it depends what you mean by "handled first". It's handled first working form the inside out, which is what happens when...
Rainer Thonnes
rainer@...
Send Email
Jan 12, 2003
10:36 pm
116
... How would you use a multi-dimensional array with insufficiently defined bounds? You can declare main as: int main(int argc, char argv[][]) But, AFAIK, you...
Bart
bart_trzynad...
Offline Send Email
Jan 12, 2003
10:39 pm
117
... The thing to remember is that the order of evaluation of a non-declarative expression does not depend on the declaration. The declaration only supplies...
Rainer Thonnes
rainer@...
Send Email
Jan 12, 2003
10:53 pm
118
... Oops, I've been thinking about this in a backwards fashion because I wanted to construct the type declarator list by always adding to the front of the ...
Bart
bart_trzynad...
Offline Send Email
Jan 13, 2003
12:13 am
119
... precedence> ... precedence> ... The problem here is this: '*'var_decl | var_decl '[' expr ']' You need an additional layer of grammar in here to ...
Graham Toal <gtoal@...>
graham_toal
Offline Send Email
Jan 13, 2003
5:11 am
120
... Or? Not a clue, sorry. I assumed it was some C++ thing! G...
Graham Toal <gtoal@...>
graham_toal
Offline Send Email
Jan 13, 2003
5:13 am
121
... cast? I didn't know it ever did. There's rules about casting lvalues (which GCC extensions break), and about taking the address of register or const data,...
Graham Toal <gtoal@...>
graham_toal
Offline Send Email
Jan 13, 2003
5:18 am
122
... recognized ... No No No! First of all there is no 'first'. There is 'higher in the parse tree'. They are not the same thing. Stop thinking about the...
Graham Toal <gtoal@...>
graham_toal
Offline Send Email
Jan 13, 2003
5:37 am
123
... Exactly. On the other hand, if he's trying to do clever stuff like creating linear lists *during* parsing, then he probably does need to know in what...
Rainer Thonnes
rainer@...
Send Email
Jan 13, 2003
1:33 pm
124
... The shift/reduce conflict I was talking about :) ... It is. But there is a small advantage in that it simplifies the grammar a bit. yacc and its clones...
Bart
bart_trzynad...
Offline Send Email
Jan 13, 2003
6:42 pm
125
... Maybe they meant "::". NAME alone cannot appear in both rules because that's ambiguous. ... Bart...
Bart
bart_trzynad...
Offline Send Email
Jan 13, 2003
6:44 pm
Messages 96 - 125 of 1320   Oldest  |  < Older  |  Newer >  |  Newest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help