[Qt-interest] Syntax Highlighter State Stack
Scott Aron Bloom
Scott.Bloom at sabgroup.com
Tue Dec 30 19:16:28 CET 2008
Did you look at the QT syntax highlighter example?
Did you look at the non-gui datatstructures given to you by QT in the
docs?
http://doc.trolltech.com/4.3/tools.html
First, think of it in a Non-QT way?? What container would you use?
Then check, does QT supply one?
If not, does someone else?
If not, write your own...
But your question is STILL a C++ question, not a QT question...
Your asking is a stack the correct way to implement this... That's for
you to decide...
If you asked, "I need a stack, and cant find it in the thousands of QT
pages of documentation, but Im sure it must exist"
I would say, look at QStack
Scott
> -----Original Message-----
> From: Neel Basu [mailto:neel.basu.z at gmail.com]
> Sent: Tuesday, December 30, 2008 10:08 AM
> To: qt-interest at trolltech.com
> Cc: Scott Aron Bloom
> Subject: Re: [Qt-interest] Syntax Highlighter State Stack
>
> 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