Lo all,
The syntax file needs some enhancements to allow for better logic for the parser. It needs to accomodate the following situations:
1) Certain tags can only have certain parents. eg: cfcatch can only exist within a cftry
2) A cftry must contain at least one cfcatch
3) Warn the user about multiple cfcatches that catch the same exception
4) cfqueryparam can only occur within a cfquery block (but can occur within a file included _within_ the cfquery... this will cause problems)
5) cfswitch can only have cfcase & cfdefaultcase tags within it
6) cfswitch can only have one cfcase that has value="fred"
7) cfswitch can only have one cfdefaultcase
8) cfcase can only occur within a cfswitch
9) cfdefaultcase can only occur within a cfswitch
Okay, so those are the example rules. We now need some way of expressing these within our syntax file.
<tag name="cftry" creator="3" single="false" xmlstyle="false">
<allows/> <!-- Allows anything -->
<requires>
<!-- Rule #2 -->
<child name="cfcatch" multiplicity="1+"/>
</requires>
</tag><tag name="cfcatch" creator="3" single="false" xmlstyle="false"/>
<allows/>
<requires>
<!-- Rule #1 -->
<ancestor name="cftry"/>
</requires>
</tag><tag name="cfswitch" creator="3" single="false" xmlstyle="false">
<allows>
<!-- Allows only the following tags, rule #5 -->
<child name="cfcase" multiplicity="*"/>
<child name="cfdefaultcase" multiplicity="1"/>
</allows>
<requires/>
</tag><cfcase name="cfdefaultcase" creator="3"
single="false" xmlstyle="false">
<allows/>
<requires>
<!-- Rule #9 -->
<parent name="cfswitch"/>
</requires>
</cfcase><tag name="cfcase" creator="3" single="false" xmlstyle="false">
<allows/>
<requires>
<!-- Rule #8 -->
<parent name="cfswitch"/>
</requires>
</tag>Comments anyone?
- - - - Oliver
MSN: [EMAIL PROTECTED] Y! : [EMAIL PROTECTED] ICQ: 145623807 Web: http://www.dts-workshop.com/blog/
-- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by
activepdf.com*
*Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
*Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*To unsubscribe, e-mail: [EMAIL PROTECTED]
