Token. something serving as an indication,proof,or expression of something else. Phrase. Two or more words in sequence that form a syntactic unit that is less than a complete sentence. Structure. mode of arrangement of parts. Grammar. The elements of any science , art , or subject. Syntax. The study of rules for the formation of …
Monthly Archives: November 2010
syntax analyzer
During syntax analysis the tokens of the source program are grouped into grammatical phrases that are used by a compiler to synthesis the output. Reference/Source: http://www.lkn.ei.tum.de/arbeiten/faq/man/tau42_help/comptheory6.html
Lexical Analysis
Lexical analysis is the process of taking an input string of characters (such as the source code of a computer program) and producing a sequence of symbols called “lexical tokens”, or just “tokens”, which may be handled more easily by a parser. A token, in computing, is a segment of text, regardess whether it be …
phases of a compiler
Phases Of a Compiler 1. Lexical Analyzer. 2. Syntax Analyzer. 3. Semantic Analyzer. 4. Intermediate Code Generator. 5. Code Optimizer. 6. Code Generator. Reference/Source: http://www.personal.kent.edu/~rmuhamma/Compilers/MyCompiler/phase.htm
object oriented programming
Class Definition Related div.entry h2.title, div.entry h1.title { padding-bottom: 22px; background-color: #4e9258 ; font-family: serif; font-size:150%;} Object-oriented programming (OOP) is a programming paradigm that uses “objects” – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs Reference/Source: http://en.wikipedia.org/wiki/Object-oriented_programming Code Exposition p.first{ color: blue; } p.second{ …
gcc limits and -Wformat
#include <stdio.h> #include <limits.h> int main (void) { unsigned long ul = LONG_MAX; short int si = SHRT_MIN; printf (“%d\n”, ul); printf (“%s\n”, si); return 0; } $gcc printme.c $./a.out -1 Segmentation fault $gcc printme.c -Wformat printme.c: In function ‘main’: printme.c:7: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘long unsigned int’ …
gcc options.
$gcc hello.c -o hello $du -h hello 8.0K hello $gcc -pg hello.c -o hello $du -h hello 8.0K hello $ls -l hello -rwxr-xr-x 1 7417 Nov 2 05:46 hello $rm hello $gcc hello.c -o hello $ls -l hello -rwxr-xr-x 1 6593 Nov 2 05:47 hello $ some content supressed. The gcc compiler accepts both single-letter …