Hi all,

I'm trying to parse a high level policy and generate a low-level structured
text.

The grammar rule for policy set and policy are:

policyset
        (policy)+
        -> ^(POLICYSET  policy+);

and

policy    : policyType^ LBRAC! targetType RBRAC!
            LBRACE!
            conditionStat?
            RBRACE!
            ->  ^(POLICY targetType conditionStat)

The generated tree look like this:

(POLICYSET (POLICY (SUBJECTS Doctor) (OBJECTS PatientRecord) (RIGHTS Read)
(CONDITION (and (= (. PatientRecord Appointment) True) (< (. Doctor
NoOfTimesRead) 5)))))

The rule for policyset in the tree grammar is as follows:

policyset:  ^(POLICYSET  (p+=policy)+) -> policySet(policies={p}) ;

and policy looks like this:

policy: conditionStat
     -> policyStat(cond={$conditionStat.st})
    ;

I guess everything else is irrelevent for the time being because of the
error that I get for parsing it:

E:\workspace\transtest\src\EvalPolicy.g: node from line 0:0 mismatched tree
node: POLICYSET expecting POLICYSET

Can anyone help me out with what's wrong here. I really have no idea what
could be wrong. I've tried many tutorials/helps/docs but without any
success.

Thanks

Nauman

Research Associate
Security Engineering Research Group
Institute of Management Sciences
Peshawar, Pakistan

Blog: http://recluze.wordpress.com
Group: http://serg.imsciences.edu.pk
Wiki: http://serg.imsciences.edu.pk/wiki
Art gallery: http://recluse.gfxartist.com

Contact number: +92 (0) 323 93 66 136

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to