Click here to Skip to main content
15,884,725 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
niconicx15-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
Lim 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
niconicx22-Sep-08 23:03 
Questionwhere to put the responsiblity + Scanner or Parser Pin
Leblanc Meneses13-Sep-08 6:54
Leblanc Meneses13-Sep-08 6:54 
AnswerRe: where to put the responsiblity + Scanner or Parser Pin
Robert.C.Cartaino13-Sep-08 9:15
Robert.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
Leblanc Meneses13-Sep-08 9:52 
QuestionHello I have a question. Pin
Dale Keller12-Sep-08 16:22
Dale 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
Alan Balkany15-Sep-08 3:23 
QuestionDetecting Analog (A/D) Pulses using Software Pin
JohnnyG12-Sep-08 2:57
JohnnyG12-Sep-08 2:57 
AnswerRe: Detecting Analog (A/D) Pulses using Software Pin
Tim Craig12-Sep-08 10:08
Tim Craig12-Sep-08 10:08 
GeneralRe: Detecting Analog (A/D) Pulses using Software Pin
JohnnyG13-Sep-08 0:30
JohnnyG13-Sep-08 0:30 
AnswerRe: Detecting Analog (A/D) Pulses using Software Pin
cp987612-Sep-08 18:10
cp987612-Sep-08 18:10 
GeneralRe: Detecting Analog (A/D) Pulses using Software Pin
JohnnyG13-Sep-08 0:27
JohnnyG13-Sep-08 0:27 
GeneralRe: Detecting Analog (A/D) Pulses using Software Pin
cp987613-Sep-08 2:40
cp987613-Sep-08 2:40 
GeneralRe: Detecting Analog (A/D) Pulses using Software Pin
JohnnyG13-Sep-08 5:36
JohnnyG13-Sep-08 5:36 
AnswerRe: Detecting Analog (A/D) Pulses using Software Pin
Leslie Sanford13-Sep-08 12:04
Leslie Sanford13-Sep-08 12:04 
GeneralRe: Detecting Analog (A/D) Pulses using Software Pin
73Zeppelin18-Sep-08 0:02
73Zeppelin18-Sep-08 0:02 
GeneralRe: Detecting Analog (A/D) Pulses using Software Pin
cp987618-Sep-08 13:30
cp987618-Sep-08 13:30 
Generalhelp regarding the flood fill algorithm Pin
niconicx11-Sep-08 13:30
niconicx11-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.