grammar PIR::Grammar; rule io_op { # # IO ops # close | fdopen \, \, [ | | ] | getfd \, | getstdin | getstdout | getstderr | setstdout | setstderr | pioctl \, \, \, | open \, [ \, ]? | printerr | print | print \, | read \, | readline \, | peek [ \, ]? | stat \, \, | seek \, \, [ \, ]? | tell \, [ \, ]? | socket \, \, \, \, | sockaddr \, \, | connect \, \, | recv \, \, | send \, \, | poll \, \, \, \, | bind \, \, | listen \, \, | accept \, } rule math_op { # # Math ops # infix \, \, | n_infix \, \, \, | abs | n_abs \, | add \, [ \, ]? | cmod \, \, | dec # | div # | fdiv # | ceil # | floor # | inc # | mod # | mul # | neg # | n_neg # | pow # | sub # | sqrt # # Transcedental math. ops; shouldn't these go into a lib? | acos # | asec # | asin # | atan # | cos # | cosh # | exp # | ln # | log10 # | log2 # | sec # | sech # | sin # | sinh # | tan # | tanh # # other math ops | gcd # | lcm # | fact # } rule string_op { # # String ops # ord # | chr # | chopn # | concat \, [ \, ]? | n_concat # | repeat # | n_repeat # | length # | bytelength # | pin # | unpin # | substr # | index # | sprintf # | new # ?? # | stringinfo # | upcase # | downcase # | titlecase # | join # | split # | charset # | charsetname # | find_charset # | trans_charset # | encoding # | find_encoding # | trans_encoding # | is_cclass # | find_cclass # | find_not_cclass # | escape # | compose # }