Click here to Skip to main content

Welcome to the Lounge

   

For lazing about and discussing anything in a software developer's life that takes your fancy.
The Lounge is rated PG. If you're about to post something you wouldn't want your kid sister to read then don't post it. No flame wars, no abusive conduct and please don't post ads.

Technical discussions are welcome, but if you need specific help please use the programming forums.


 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
GeneralRe: I don't know how I survived this long PinmentorKeith Barrow14-Mar-13 3:01 
GeneralRe: I don't know how I survived this long PinmemberMark_Wallace14-Mar-13 3:31 
GeneralRe: I don't know how I survived this long PinmemberNagy Vilmos14-Mar-13 3:41 
GeneralRe: I don't know how I survived this long PinmemberMike Hankey14-Mar-13 10:35 
GeneralRe: I don't know how I survived this long Pinmember_Maxxx_14-Mar-13 14:18 
GeneralRe: I don't know how I survived this long PinmemberMycroft Holmes14-Mar-13 14:25 
GeneralMy Brian Hurts PinmemberNagy Vilmos14-Mar-13 0:47 
What started out as refactoring rapidly became rewriting and has now advanced to reimplementing.
 
I have stepped waaaaaay back on my Expression Evaluator. There was a wee bug in comparing values that showed a flaw in the way it all works. I had a small Eureka moment and found this description for an expression:
 * <pre>  EXPRESSION     ::= ID "=" ELEMENT
                   | LOGICAL_OR
  LOGICAL_OR     ::= LOGICAL_AND "||" LOGICAL_OR
                   | LOGICAL_AND
  LOGICAL_AND    ::= COMPARE "&&" LOGICAL_AND
                   | COMPARE
  COMPARE        ::= SUM "<" SUM
                   | SUM "<=" SUM
                   | SUM "==" SUM
                   | SUM "!=" SUM
                   | SUM ">=" SUM
                   | SUM ">" SUM
                   | SUM
  SUM            ::= TERM "+" SUM
                   | TERM "-" SUM
                   | TERM
  TERM           ::= FACTOR "*" TERM
                   | FACTOR "/" TERM
                   | FACTOR
  FACTOR         ::= PRIMARY "^" FACTOR
                   | PRIMARY "%" FACTOR
                   | PRIMARY
  PRIMARY        ::= "-" ELEMENT
                   | "!" ELEMENT
                   | ELEMENT
  ELEMENT        ::= ID
                   | CONSTANT
                   | "(" EXPRESSION ")"
So each item is a class of it's own and I can build the hierarchy quite easily.
The first go at evaluation works well, but then comes re-factorisation pain. Most of the types have two sides so the super class takes two expressions. What I then wanted to do was process the two sides, validate them and then bring them together. I come up with a interface and it works.
 
Bollocks does it. It has to evaluate both sides, so I need to complicate things by deciding if it should continue after the first evaluation. I'm thinking of just making it support any number of the same type of expressions and allow it to evaluate them one after another and decide when to stop.
 
Re-Write City Arizona, here I come!
Reality is an illusion caused by a lack of alcohol

JokeRe: My Brian Hurts PinmemberV.14-Mar-13 0:57 
GeneralRe: My Brian Hurts Pinmemberharold aptroot14-Mar-13 0:57 
GeneralRe: My Brian Hurts PinmemberNagy Vilmos14-Mar-13 1:00 
GeneralRe: My Brian Hurts Pinmemberharold aptroot14-Mar-13 1:04 
GeneralRe: My Brian Hurts PinmemberNagy Vilmos14-Mar-13 1:10 
GeneralRe: My Brian Hurts Pinmemberharold aptroot14-Mar-13 1:35 
GeneralRe: My Brian Hurts PinmemberShameel14-Mar-13 3:11 
GeneralRe: My Brian Hurts PinmemberNagy Vilmos14-Mar-13 3:23 
GeneralRe: My Brian Hurts PinmemberMark_Wallace14-Mar-13 3:32 
GeneralRe: My Brian Hurts PinmemberNagy Vilmos14-Mar-13 3:34 
GeneralRe: My Brian Hurts PinmemberMark_Wallace14-Mar-13 3:46 
GeneralRe: My Brian Hurts PinmemberRob Grainger14-Mar-13 4:02 
GeneralRe: My Brian Hurts PinmemberPIEBALDconsult14-Mar-13 3:53 
GeneralRe: My Brian Hurts PinmemberJoe Woodbury14-Mar-13 4:34 
GeneralRe: My Brian Hurts PinmemberBig Daddy Farang14-Mar-13 6:00 
GeneralXKCDOTD PinprotectorPete O'Hanlon14-Mar-13 0:37 
GeneralRe: XKCDOTD PinmemberMatthew Faithfull14-Mar-13 0:48 
GeneralRe: XKCDOTD PinmemberNagy Vilmos14-Mar-13 0:58 

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

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


Advertise | Privacy | Mobile
Web04 | 2.6.130617.1 | Last Updated 19 Jun 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid