Sha256: eb8c6a8410b1957943428599dae2e13eae9cfc855ce42588225464fbb6de2343

Contents?: true

Size: 1.01 KB

Versions: 18

Compression:

Stored size: 1.01 KB

Contents

# $Id$
#
# Rules for verious lists.
# This file is just an example, you cannot compile this file.

class ExampleOnly
rule

# a list, which minimum number of items is 0
list0 :
          {
            result = []
          }
      | list0 item
          {
            result.push val[1]
          }

# a list, which minimum number of items is 1
list1 : item
          {
            result = val
          }
      | list1 item
          {
            result.push val[1]
          }

# a list, separated by comma
clist : item
          {
            result = val
          }
      | clist ',' item
          {
            result.push val[2]
          }

# a hash. see also "hash.y".
hash  : '{' hash_contents '}'
          {
            result = val[1]
          }
      | '{' '}'
          {
            result = {}
          }

hash_contents
      : item "=>" item
          {
            result = { val[0] => val[2] }
          }
      | hash_contents ',' item "=>" item
          {
            result[val[2]] = val[4]
          }

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
racc-1.4.16-java sample/lists.y
racc-1.4.16 sample/lists.y
racc-1.4.15-java sample/lists.y
racc-1.4.15 sample/lists.y
racc-1.4.14-java sample/lists.y
racc-1.4.14 sample/lists.y
racc-1.4.13-java sample/lists.y
racc-1.4.13 sample/lists.y
racc-1.4.12-java sample/lists.y
racc-1.4.12 sample/lists.y
racc-1.4.11 sample/lists.y
gd-racc-1.4.11 sample/lists.y
racc-1.4.10 sample/lists.y
racc-1.4.9-java sample/lists.y
racc-1.4.9 sample/lists.y
racc-1.4.8 sample/lists.y
racc-1.4.7 sample/lists.y
racc-1.4.6 sample/lists.y