import fn_operations
import loop
import math_operations
import qqio
import queue
import cond

identifiers = {
    'call': fn_operations.FnCall,
    'def': fn_operations.FnDef,
    'ret': fn_operations.Ret,
    'exec': fn_operations.Exec,
    '+': math_operations.Add,
    'r+': math_operations.RAdd,
    'q+': math_operations.QAdd,
    '-': math_operations.Sub,
    'r-': math_operations.RSub,
    'q-': math_operations.QSub,
    '*': math_operations.Mul,
    'r*': math_operations.RMul,
    'q*': math_operations.QMul,
    '/': math_operations.Div,
    'r/': math_operations.RDiv,
    'q/': math_operations.QDiv,
    '%': math_operations.Mod,
    'r%': math_operations.RMod,
    'q%': math_operations.QMod,
    '**': math_operations.Exp,
    'r**': math_operations.RExp,
    'q**': math_operations.QExp,
    '&': math_operations.BitAnd,
    'r&': math_operations.RBitAnd,
    'q&': math_operations.QBitAnd,
    '|': math_operations.BitOr,
    'r|': math_operations.RBitOr,
    'q|': math_operations.QBitOr,
    '^': math_operations.BitXor,
    'r^': math_operations.RBitXor,
    'q^': math_operations.QBitXor,
    'inc': math_operations.Inc,
    'rinc': math_operations.RInc,
    'qinc': math_operations.QInc,
    'dec': math_operations.Dec,
    'rdec': math_operations.RDec,
    'qdec': math_operations.QDec,
    'QQ': qqio.QQ,
    'read_line': qqio.ReadLine,
    'read_num': qqio.ReadNumber,
    'print': qqio.Print,
    'write': qqio.Write,
    'rot': queue.Rot,
    'rrot': queue.RRot,
    'qrot': queue.QRot,
    'pop': queue.Pop,
    'rpop': queue.RPop,
    'qpop': queue.QPop,
    'push': queue.Push,
    'rpush': queue.RPush,
    'qpush': queue.QPush,
    'drain': queue.Drain,
    'rdrain': queue.RDrain,
    'qdrain': queue.QDrain,
    'rqalloc': queue.RQAlloc,
    'pack': queue.Pack,
    'dup': queue.Dup,
    'rdup': queue.RDup,
    'qdup': queue.QDup,
    'if': cond.If,
    'ifelse': cond.IfElse,
    'loop': loop.Loop,
    'rifbreak': loop.RIfBreak,
    'break': loop.Break,
    'not': cond.Not,
    'rnot': cond.RNot,
    'qnot': cond.QNot,
    '==': cond.Equals,
    'r==': cond.REquals,
    'q==': cond.QEquals,
    '!=': cond.NotEquals,
    'r!=': cond.RNotEquals,
    'q!=': cond.QNotEquals,
    '<': cond.LessThan,
    'r<': cond.RLessThan,
    'q<': cond.QLessThan,
    '<=': cond.LessThanEquals,
    'r<=': cond.RLessThanEquals,
    'q<=': cond.QLessThanEquals,
    '>': cond.GreaterThan,
    'r>': cond.RGreaterThan,
    'q>': cond.QGreaterThan,
    '>=': cond.GreaterThanEquals,
    'r>=': cond.RGreaterThanEquals,
    'q>=': cond.QGreaterThanEquals,
}


def Identifier(name):
    global identifiers
    return identifiers[name]()
