how to parse class in class

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to parse class in class

Jens Kallup
Hello,

I would like to parse a CLASS in CLASS dynamically.
How can I do it?

qi::rule<Iterator, Skipper> symbol_def_class;

symbol_class    = "CLASS"
symbol_of       = "OF"
symbol_endclass = "ENDCLASS"

symbol_alpha = +[a-zA-Z] *[a-zA-Z0-9_]


              symbol_def_class =
                  (symbol_class >> symbol_alpha >> symbol_of >>
symbol_alpha >>
                   symbol_endclass >> (qi::eoi | qi::eol))
                  |
                  (symbol_class >> symbol_alpha >> symbol_of >>
symbol_alpha >>
                  (symbol_def_class_inner) >>
                   symbol_endclass >> (qi::eoi | qi::eol))
                  ;

              symbol_def_class_inner =
                  *( symbol_class >> symbol_alpha >> symbol_of  >>
symbol_alpha
                  >  symbol_endclass)
                  |
                  *( symbol_class >> symbol_alpha >> symbol_of  >>
symbol_alpha
                  >> *(symbol_def_class_inner) > symbol_endclass)
                  ;

As Result:

CLASS
...
     CLASS
     ...
     ENDCLASS
....
ENDCLASS

TIA
Jens


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: how to parse class in class

Jens Kallup
sorry typo, should be:

CLASS name OF parname
...
     CLASS name OF parname
     ...
     ENDCLASS
...
ENDCLASS


Am 02.11.2016 um 21:56 schrieb Jens Kallup:
> CLASS
> ...
>       CLASS
>       ...
>       ENDCLASS
> ....
> ENDCLASS


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general