View previous topic :: View next topic |
Author |
Message |
Schnorrenberg
Joined: 10 Aug 2006 Posts: 8
|
Posted: Sat Aug 26, 2006 1:52 pm Post subject: Defining a range with same start-end-rule |
|
|
Hello Michael,
I want to define a range (start-end), which detects such a header section:
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(QUERY_TABLE) TYPE DD02L-TABNAME
*" VALUE(ROWCOUNT) TYPE SOID-ACCNT DEFAULT 0
*" EXPORTING
*" VALUE(ROWSREAD) TYPE SOID-ACCNT
*" VALUE(DATAPATH) TYPE RFCPUT-PATH
*" VALUE(RECSIZE) TYPE SOID-ACCNT
*" TABLES
*" FIELDS STRUCTURE RFC_DB_FLD
*" OPTIONS STRUCTURE RFC_DB_OPT
*" ORDERBY STRUCTURE RFC_DB_FLD
*" EXCEPTIONS
*" TABLE_NOT_AVAILABLE
*" TABLE_WITHOUT_DATA
*" FIELD_NOT_VALID
*" NOT_AUTHORIZED
*" FILE_ERROR
*"
*"----------------------------------------------------------------------
Is this possible? (I fail, because the start-rule is the same as the end-rule *"-------------)
Hans-Jürgen |
|
Back to top |
|
|
Schnorrenberg
Joined: 10 Aug 2006 Posts: 8
|
Posted: Sat Aug 26, 2006 2:57 pm Post subject: |
|
|
I found a solution:
Defining:
1.Token "HeaderLine" with regex \*"-+
2.Range End "Header End" with condition "HeaderLine" and Parent Block "Header" and cancel rules.
3.Range Start "Header" with Range End "Header End" and condition "HeaderLine"
Is this correct? |
|
Back to top |
|
|
itsatomic
Joined: 12 Jun 2006 Posts: 38
|
Posted: Sun Aug 27, 2006 3:08 am Post subject: |
|
|
Wow, impressive. Being able to create complex or just complete syntax settings for different languages is pretty much the final frontier for me with this control - I just have no really good idea where to start and am too scared to look through the code to "work it out".
I'd love to have 4-5 tutorials based on creating the lexer / syntax analyser for a relatively complex language, from start to finish. |
|
Back to top |
|
|
econtrol Site Admin
Joined: 09 Jun 2006 Posts: 202
|
Posted: Mon Aug 28, 2006 9:36 am Post subject: |
|
|
Yes, this solution is correct.
P.S. Lexer design tutorial will be in new documentation.
Michael. |
|
Back to top |
|
|
|