[Qt-interest] Syntax Highlighter State Stack

Neel Basu neel.basu.z at gmail.com
Tue Dec 30 19:07:49 CET 2008


No The reason for which I am asking is QSyntaxHighlighter provides
int previousBlockState () const
void setCurrentBlockState ( int newState )
int currentBlockState () const
function which seems to keep track of state data in two integer variables.

But what I am trying to do is keeping a stack of states.
So I'll not make mush use of these Qt methods rather I'll use mine.

Thanks why I am asking to make sure am I running through a wrong track  ??

On Tuesday 30 Dec 2008 11:29:42 pm Scott Aron Bloom wrote:
> What does this have to do with QT?  This is simple C++ data structure
> theory.
> 
> Scott
> 
> > -----Original Message-----
> > From: qt-interest-bounces at trolltech.com [mailto:qt-interest-
> > bounces at trolltech.com] On Behalf Of Neel Basu
> > Sent: Tuesday, December 30, 2008 9:51 AM
> > To: Qt Interest
> > Subject: [Qt-interest] Syntax Highlighter State Stack
> > 
> > I am Making a Syntax Highlighter for PHP
> > there are a lot of states such as
> > 		enum State{
> > 			NormalState = -1,
> > 			InPHPCodeBlock,
> > 			InFunction,
> > 			InClass,
> > 			InMultiComment,
> > 			InCurlyBraces
> > 		};
> > Now Its possible that some code block is in InMultiComment which is in
> > InFnction which is in InPHPCodeBlock
> > It is not possible to keep informations about these states in a single
> integer
> > variable.
> > (Is it ??)
> > So I thought to keep a vector for this enum values which will be used
> as a
> > StateStack
> > 
> > Now the question is am I on the right Track ?? or there are easier or
> safer or
> > more standard alternatives ??
> > 
> > Neel
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 



-- 
Zigmoyd PHP Framework http://zigmoyd.net



More information about the Qt-interest-old mailing list