Am Tuesday 12 May 2009 08:35:29 schrieb Nauman: > 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}) > ;
should the policy rule in the tree grammar match the generated tree?, like: policy: ^(POLICY targetType conditionStat) -> policyStat(cond={$conditionStat.st}) cheers, Michael List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to il-antlr-interest@googlegroups.com To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---