# Copyright (C) 2007, The Perl Foundation.
# $Id: /mirror/trunk/languages/perl6/src/parser/grammar-oper.pg 35805 2009-01-19T22:19:34.159218Z jonathan  $

## autoincrement
proto postfix:<++> is precedence('x=') is lvalue(1) { ... }
proto postfix:<--> is equiv(postfix:<++>) is lvalue(1) { ... }
proto prefix:<++> is equiv(postfix:<++>) is lvalue(1) { ... }
proto prefix:<--> is equiv(postfix:<++>) is lvalue(1) { ... }
proto postfix:<i> is equiv(postfix:<++>) { ... }

## exponentiation
proto infix:<**> is precedence('w=') { ... }

## symbolic unary
proto prefix:<+> is precedence('v=') { ... }
proto prefix:<-> is equiv(prefix:<+>) { ... }
proto prefix:<~> is equiv(prefix:<+>) { ... }
proto prefix:<?> is equiv(prefix:<+>) { ... }
proto prefix:<!> is equiv(prefix:<+>) { ... }
proto prefix:<+^> is equiv(prefix:<+>)
    is pirop('bnot')
    { ... }
proto prefix:<=> is equiv(prefix:<+>) { ... }
proto prefix:<^> is equiv(prefix:<+>) { ... }
proto prefix:<\> is equiv(prefix:<+>) { ... }
proto prefix:<|> is equiv(prefix:<+>) { ... }

## multiplicative operators
proto infix:<*> is precedence('u=') { ... }
proto infix:</> is equiv(infix:<*>) { ... }
proto infix:<%> is equiv(infix:<*>) { ... }
proto infix:<+&> is equiv(infix:<*>) { ... }
proto infix:<+^> is equiv(infix:<*>) { ... }
proto infix:«+<» is equiv(infix:<*>) { ... }
proto infix:«+>» is equiv(infix:<*>) { ... }
proto infix:<~&> is equiv(infix:<*>) { ... }
proto infix:«~<» is equiv(infix:<*>) { ... }
proto infix:«~>» is equiv(infix:<*>) { ... }
proto infix:<?&> is equiv(infix:<*>) { ... }
proto infix:<div> is equiv(infix:<*>) { ... }
proto infix:<mod> is equiv(infix:<*>) { ... }

## additive operators
proto infix:<+> is precedence('t=') { ... }
proto infix:<-> is equiv(infix:<+>) { ... }
proto infix:<+|> is equiv(infix:<+>) { ... }
proto infix:<+^> is equiv(infix:<+>) { ... }
proto infix:<~|> is equiv(infix:<+>) { ... }
proto infix:<~^> is equiv(infix:<+>) { ... }
proto infix:<?|> is equiv(infix:<+>) { ... }
proto infix:<?^> is equiv(infix:<+>) { ... }

## replication
proto infix:<x> is precedence('s=') { ... }
proto infix:<xx> is equiv(infix:<x>) { ... }

## concatenation
proto infix:<~> is precedence('r=') { ... }

## junctive and
proto infix:<&> is precedence('q=')
    is assoc('list')
    { ... }

## junctive or
proto infix:<|> is precedence('p=')
    is assoc('list')
    { ... }
proto infix:<^> is equiv(infix:<|>)
    is assoc('list')
    { ... }

## named unary
proto prefix:<abs> is precedence('o=') is subname('abs') { ... }
proto prefix:<HOW> is equiv(prefix:<abs>) is subname('HOW') { ... }
proto prefix:<WHAT> is equiv(prefix:<abs>) is subname('WHAT') { ... }
proto prefix:<pop> is equiv(prefix:<abs>) is subname('pop') { ... }
proto prefix:<shift> is equiv(prefix:<abs>) is subname('shift') { ... }
proto prefix:<defined> is equiv(prefix:<abs>) is subname('defined') { ... }

## nonchaining
proto infix:<..> is precedence('n=') { ... }
proto infix:<..^> is equiv(infix:<..>) { ... }
proto infix:<^..> is equiv(infix:<..>) { ... }
proto infix:<^..^> is equiv(infix:<..>) { ... }
proto infix:«<=>» is equiv(infix:<..>) { ... }
proto infix:<cmp> is equiv(infix:<..>) { ... }
proto infix:<leg> is equiv(infix:<..>) { ... }
proto infix:<=:=> is equiv(infix:<..>) { ... }
proto infix:<!=:=> is equiv(infix:<..>) { ... }
proto infix:<does> is equiv(infix:<..>) { ... }
proto infix:<but> is equiv(infix:<..>) { ... }

## chaining
proto infix:<==>  is precedence('m=') is pasttype('chain') { ... }
proto infix:<!=>  is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:<!==>  is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:«<»   is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:«<=»  is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:«>»   is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:«>=»  is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:<eq>  is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:<!eq>  is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:<ne>  is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:<lt>  is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:<le>  is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:<gt>  is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:<ge>  is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:<~~>  is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:<!~~>  is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:<===> is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:<!===> is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:<eqv> is equiv(infix:<==>) is pasttype('chain') { ... }
proto infix:<!eqv> is equiv(infix:<==>) is pasttype('chain') { ... }

## tight and
proto infix:<&&> is precedence('l=')
    is pasttype('if')
    { ... }

## tight or
proto infix:<||> is precedence('k=')
    is pasttype('unless')
    { ... }
proto infix:<^^> is equiv(infix:<||>)
    is pasttype('xor')
    { ... }
proto infix:<//> is equiv(infix:<||>)
    is pasttype('def_or')
    { ... }
proto infix:<min> is equiv(infix:<||>) 
    is assoc('list')
    { ... }
proto infix:<max> is equiv(infix:<||>)
    is assoc('list')
    { ... }

## conditional
proto ternary:<?? !!> is precedence('j=') is pasttype('if') is assoc('right') { ... }

## item assignment
proto infix:<:=> is precedence('i=') is pasttype('bind') { ... }
proto infix:<::=> is equiv(infix:<:=>) { ... }
proto infix:<.=> is equiv(infix:<:=>) { ... }
proto infix:«=>» is equiv(infix:<:=>) { ... }
proto infix:<//=> is equiv(infix:<:=>) { ... }

## loose unary
proto prefix:<true> is precedence('h=') is subname('true') { ... }
proto prefix:<not> is equiv(prefix:<true>) is subname('not') { ... }

## comma
proto infix:<,> is precedence('g=')
    is assoc('list')
    is nullterm
    { ... }
proto infix:«p5=>» is equiv(infix:<,>) is subname('infix:,') { ... }

## list infix
proto infix:<X> is precedence('f=')
    is assoc('list')
    { ... }
proto infix:<X,X> is equiv(infix:<X>)
    is assoc('list')
    is subname('infix:X')
    { ... }
proto infix:<Z> is equiv(infix:<X>)
    is assoc('list')
    { ... }

## list assignment
proto infix:<=> is precedence('e=')
    is assoc('right')
    is lvalue(1)
    { ... }
proto prefix:<[,]> is precedence('e=') is subname('list') {...}
proto prefix:<[&]> is equiv(prefix:<[,]>) is subname('all') {...}
proto prefix:<[|]> is equiv(prefix:<[,]>) is subname('any') {...}
proto prefix:<[^]> is equiv(prefix:<[,]>) is subname('one') {...}

## loose and
proto infix:<and> is precedence('d=')
    is pasttype('if')
    { ... }
proto infix:<andthen> is equiv(infix:<and>) { ... }

## loose or
proto infix:<or> is precedence('c=')
    is pasttype('unless')
    { ... }
proto infix:<xor> is equiv(infix:<or>)
    is pasttype('xor')
    { ... }
proto infix:<orelse> is equiv(infix:<or>) { ... }
