Revision b921cd5...
Go back to digest for 4th September 2011Bug Fixes in Utilities
Multiple fixes/enhancements, making generic matching work correctly
- Fix non-greedy KleenePlus/KleeneStar matching, by also testing
following items of parent syntax items (stored in new MatchData
structure).
- Match functions in SyntacticalAnalyzer now have the same signature
"function(MatchData *matchData, MatchItems *matchedItems);".
The MatchData object contains information about the current item
to be matched, following items, the parent MatchItem to add output to,
etc. The MatchedItems list contains a list of all items matched in
the function (it's a list for KleeneStar/KleenePlus).
- Change SyntacticalAnalyzer::analyze() to use the new generic parsing
system, ie. using a root SyntaxItem.
- Remove AnalyzerRL and old (non-generic) parsing functions from
SyntacticalAnalyzer. Right-to-left parsing is not needed anymore,
thanks to the new generic parsing system using syntax item trees.
- Updated syntax definition for journey searches to also allow stop
names without double quotes (works thanks to fixed KleenePlus).
- New method for updating a matched input string (adding, removing,
changing items). This is done using a syntax item tree, ie. it for
example inserts new syntax items at the correct places.
- Macros for printing pretty debug output while parsing.
- Removing invalid characters from input (instead of rejecting input
in lexical analyzer).
- Update and enhance unit tests.
- Spelling fix: Errornous => Erroneous.
File Changes
- applet/datasourcetester.h
- applet/journeysearchenums.h
- applet/journeysearchlineedit.h
- applet/journeysearchparser.cpp
- applet/journeysearchparser.h
- applet/journeysearchsuggestionwidget.cpp
- applet/lexem.cpp
- applet/lexem.h
- applet/matchitem.cpp
- applet/matchitem.h
- applet/publictransport.cpp
- applet/syntaxitem.cpp
- applet/syntaxitem.h
- applet/tests/JourneySearchParserTest.cpp