That seems pretty interesting. Are there any online courses where it would be possible to learn programming that way?turdus wrote: For me at the university in the first 2 semesters we learned programming by only matchematical mean with paper and pencil. I'm pretty sure you cannot imagine this (or even imagine how to learn programming without a computer). You can bet most of you would cry if had to understand the matchematical formula of a simple loop (for the courious, I've attached it). So my learning language was math. Later I had courses that tought how specific languages like C, ADA, Eiffel, Java etc. implement that theory.
Writing a compiler - how?
Re: Writing a compiler - how?
Using 700MHz Pentium III machine with 64MB of RAM because I feel like it.
ed implementation in C: main(a){for(;;;){read(0,&a,1);if(a=='\n')write(1,"?\n",2);}}
ed implementation in C: main(a){for(;;;){read(0,&a,1);if(a=='\n')write(1,"?\n",2);}}
Re: Writing a compiler - how?
Don't think so, did not find anything on the university's homepage (only student exchange program). But I've found an english description of the training:JuEeHa wrote:That seems pretty interesting. Are there any online courses where it would be possible to learn programming that way?
http://www.inf.elte.hu/english/studies/ ... ammes.aspx
Funny how things change, when I attended to (several years ago), there was no such thing, BSc/MSc just an university degree. There was no geoinformatics then, and no media courses.
I feel old...
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Writing a compiler - how?
The closest thing to program logic I know is http://www.cs.uu.nl/docs/vakken/pc/1112 ... s/main.pdf - and fortunately it was in English. It's probably nowhere near ancient CS teachings and it basically works the opposite direction by reducing code to a mathematical representation.
More on topic would be http://www.cs.uu.nl/wiki/pub/TC/CourseM ... 111101.pdf - I don't have the dragon book so I can't say how much better it is, but this is definitely cheaper .
More on topic would be http://www.cs.uu.nl/wiki/pub/TC/CourseM ... 111101.pdf - I don't have the dragon book so I can't say how much better it is, but this is definitely cheaper .
Re: Writing a compiler - how?
You were correct, Rudster816 was wrong.MessiahAndrw wrote:I stand corrected. May explain a couple of bugs I've encountered in the past.Rudster816 wrote:I think you need to read your own link . Number 8 is >, <, >=, <=. Number 13 is &&.
I've got into the habit of explicitly using brackets lately since I deal with many languages day-to-day, just for situations like this!
That table is ordered lowest-to-highest precedence. I have my C99 standard open in front of me, but to save me typing it all out I below paste part of the comment from Clang's function "ParseExpression".
Code: Select all
/// multiplicative-expression: [C99 6.5.5]
/// Note: in C++, apply pm-expression instead of cast-expression
/// cast-expression
/// multiplicative-expression '*' cast-expression
/// multiplicative-expression '/' cast-expression
/// multiplicative-expression '%' cast-expression
///
/// additive-expression: [C99 6.5.6]
/// multiplicative-expression
/// additive-expression '+' multiplicative-expression
/// additive-expression '-' multiplicative-expression
///
/// shift-expression: [C99 6.5.7]
/// additive-expression
/// shift-expression '<<' additive-expression
/// shift-expression '>>' additive-expression
///
/// relational-expression: [C99 6.5.8]
/// shift-expression
/// relational-expression '<' shift-expression
/// relational-expression '>' shift-expression
/// relational-expression '<=' shift-expression
/// relational-expression '>=' shift-expression
///
/// equality-expression: [C99 6.5.9]
/// relational-expression
/// equality-expression '==' relational-expression
/// equality-expression '!=' relational-expression
///
/// AND-expression: [C99 6.5.10]
/// equality-expression
/// AND-expression '&' equality-expression
///
/// exclusive-OR-expression: [C99 6.5.11]
/// AND-expression
/// exclusive-OR-expression '^' AND-expression
///
/// inclusive-OR-expression: [C99 6.5.12]
/// exclusive-OR-expression
/// inclusive-OR-expression '|' exclusive-OR-expression
///
/// logical-AND-expression: [C99 6.5.13]
/// inclusive-OR-expression
/// logical-AND-expression '&&' inclusive-OR-expression
///
/// logical-OR-expression: [C99 6.5.14]
/// logical-AND-expression
/// logical-OR-expression '||' logical-AND-expression
///
/// conditional-expression: [C99 6.5.15]
/// logical-OR-expression
/// logical-OR-expression '?' expression ':' conditional-expression
/// [GNU] logical-OR-expression '?' ':' conditional-expression
/// [C++] the third operand is an assignment-expression
///
/// assignment-expression: [C99 6.5.16]
/// conditional-expression
/// unary-expression assignment-operator assignment-expression
/// [C++] throw-expression [C++ 15]
///
/// assignment-operator: one of
/// = *= /= %= += -= <<= >>= &= ^= |=
///
/// expression: [C99 6.5.17]
/// assignment-expression ...[opt]
/// expression ',' assignment-expression ...[opt]