kids encyclopedia robot

Image: Xxx Scanner and parser example for C

Kids Encyclopedia Facts
Original image(1,033 × 715 pixels, file size: 9 KB, MIME type: image/gif)

Description: Scanner (a.k.a. lexer) and parser example for C. Starting from the sequence of characters "if(net>0.0)total+=net*(1.0+tax/100.0);", the scanner composes a sequence of tokens, and categorizes each of them, e.g. as identifier, reserved word, number literal, or operator. The latter sequence is transformed by the parser into a syntax tree, which is then treated by the remaining compiler phases. The scanner and parser handles the regular and properly context-free parts of the grammar for C, respectively.
Title: Xxx Scanner and parser example for C
Credit: Own work
Author: Jochen Burghardt
Usage Terms: Creative Commons Attribution-Share Alike 3.0
License: CC BY-SA 3.0
License Link: https://creativecommons.org/licenses/by-sa/3.0
Attribution Required?: Yes

The following page links to this image:

kids search engine