Click here to Skip to main content
14,922,882 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: pseudorandom number generator algorithm Pin
Roger Wright19-Sep-08 11:14
professionalRoger Wright19-Sep-08 11:14 
GeneralRe: pseudorandom number generator algorithm Pin
niconicx15-Sep-08 22:53
Memberniconicx15-Sep-08 22:53 
GeneralRe: pseudorandom number generator algorithm Pin
CPallini15-Sep-08 22:59
mveCPallini15-Sep-08 22:59 
GeneralRe: pseudorandom number generator algorithm Pin
Lim Yuxuan16-Sep-08 4:41
MemberLim Yuxuan16-Sep-08 4:41 
GeneralRe: pseudorandom number generator algorithm Pin
CPallini16-Sep-08 5:29
mveCPallini16-Sep-08 5:29 
GeneralRe: pseudorandom number generator algorithm Pin
niconicx22-Sep-08 23:03
Memberniconicx22-Sep-08 23:03 
Questionwhere to put the responsiblity + Scanner or Parser Pin
Leblanc Meneses13-Sep-08 6:54
MemberLeblanc Meneses13-Sep-08 6:54 
AnswerRe: where to put the responsiblity + Scanner or Parser Pin
Robert.C.Cartaino13-Sep-08 9:15
MemberRobert.C.Cartaino13-Sep-08 9:15 
I can only speak from a compiler-creation point of view but scanners (lexical analyzers) are generally pretty simple... much simpler than the parser-portion of the process. My "rule of thumb" is that the scanner/lexical analyzer (lexer) scans the input file, breaks it into tokens, and identifies the type of token. Done. It knows nothing about syntax. That is where the parser takes over.

Maybe this is just a matter of semantics, but if your parser is taking up too much responsibility, rather than leaning on the scanner to provide more information, maybe you can break the parser down into more parts and divide the responsibility that way (again, speaking from a compiler point of view):

1. Scanner (Lexical Analysis) - Break your source code down into small tokens.
2. Parsing (Syntax Analysis) - Check for correct syntax and build your abstract syntax tree (AST). The parser checks strictly for syntactic correctness and stops there.
3. Tree Analysis (don't know the "real" name for this subtask) - Analyze and add information to your your syntax tree for semantic correctness (i.e. variables declared, initialize to default values, etc).
4. Optimization / Generation - What this is depends greatly on what your specific task is.

Enjoy,

Robert C. Cartaino
GeneralRe: where to put the responsiblity + Scanner or Parser Pin
Leblanc Meneses13-Sep-08 9:52
MemberLeblanc Meneses13-Sep-08 9:52 
QuestionHello I have a question. Pin
Dale Keller12-Sep-08 16:22
MemberDale Keller12-Sep-08 16:22 
AnswerRe: Hello I have a question. Pin
Roger Wright12-Sep-08 21:57
professionalRoger Wright12-Sep-08 21:57 
AnswerRe: Hello I have a question. Pin
CPallini13-Sep-08 1:02
mveCPallini13-Sep-08 1:02 
AnswerRe: Hello I have a question. Pin
Paul Conrad13-Sep-08 5:39
professionalPaul Conrad13-Sep-08 5:39 
AnswerRe: Hello I have a question. Pin
Alan Balkany15-Sep-08 3:23
MemberAlan Balkany15-Sep-08 3:23 
QuestionDetecting Analog (A/D) Pulses using Software Pin
JohnnyG12-Sep-08 2:57
MemberJohnnyG12-Sep-08 2:57 
AnswerRe: Detecting Analog (A/D) Pulses using Software Pin
Tim Craig12-Sep-08 10:08
MemberTim Craig12-Sep-08 10:08 
GeneralRe: Detecting Analog (A/D) Pulses using Software Pin
JohnnyG13-Sep-08 0:30
MemberJohnnyG13-Sep-08 0:30 
AnswerRe: Detecting Analog (A/D) Pulses using Software Pin
cp987612-Sep-08 18:10
Membercp987612-Sep-08 18:10 
GeneralRe: Detecting Analog (A/D) Pulses using Software Pin
JohnnyG13-Sep-08 0:27
MemberJohnnyG13-Sep-08 0:27 
GeneralRe: Detecting Analog (A/D) Pulses using Software Pin
cp987613-Sep-08 2:40
Membercp987613-Sep-08 2:40 
GeneralRe: Detecting Analog (A/D) Pulses using Software Pin
JohnnyG13-Sep-08 5:36
MemberJohnnyG13-Sep-08 5:36 
AnswerRe: Detecting Analog (A/D) Pulses using Software Pin
Leslie Sanford13-Sep-08 12:04
MemberLeslie Sanford13-Sep-08 12:04 
GeneralRe: Detecting Analog (A/D) Pulses using Software Pin
73Zeppelin18-Sep-08 0:02
Member73Zeppelin18-Sep-08 0:02 
GeneralRe: Detecting Analog (A/D) Pulses using Software Pin
cp987618-Sep-08 13:30
Membercp987618-Sep-08 13:30 
Generalhelp regarding the flood fill algorithm Pin
niconicx11-Sep-08 13:30
Memberniconicx11-Sep-08 13:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.