diff options
Diffstat (limited to 'pkgtools/pkglint/files/license.y')
-rwxr-xr-x | pkgtools/pkglint/files/license.y | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/pkgtools/pkglint/files/license.y b/pkgtools/pkglint/files/license.y new file mode 100755 index 00000000000..802fc8a3713 --- /dev/null +++ b/pkgtools/pkglint/files/license.y @@ -0,0 +1,35 @@ +%{ +package main +%} + +%token <Node> ltNAME +%token ltAND ltOR ltOPEN ltCLOSE + +%union { + Node *LicenseCondition +} + +%type <Node> start list condition + +%% + +start : list { + liyylex.(*licenseLexer).result = $$ +} + +list : condition { + $$ = $1 +} +list : list ltAND condition { + $$.And = append($$.And, $3) +} +list : list ltOR condition { + $$.Or = append($$.Or, $3) +} + +condition : ltNAME { + $$ = $1 +} +condition : ltOPEN list ltCLOSE { + $$ = &LicenseCondition{Main: $2} +} |