Search This Blog

Tuesday, April 13, 2010

Simulation: Update on the Complex Parser

This is a quick update on the software.  I was able to separate the string into separate tokens.  There are 3 types of tokens:

0 = Real Token
1 = Imaginary Token
2 = Inner Token (within parenthesis).

What will happen on a later date, this "Evaluate" subroutine will turn the real token into a complex number and the imaginary token into a complex number.  The inner token will go back through the "Evaluate" subroutine (without the parenthesis) until a complex number is returned.  This method is using recursion to evaluate a full complex string.

The next step will be to perform the math in operator precedence.  This may get a little tricky since they aren't in order when I produce the tokens.  Based on my current structure, this isn't easily done.  But now that I have a structure I can possibly work around this. Wish me luck

---------
Justin Coulston
Justin.Coulston@gmail.com

No comments:

Post a Comment