/** * Returns the most specific Java instance for a given INode. * If the node is an aggregation, it will be returned as instance of * Aggregation. * If the node is a function call, it will be returned as instance of * FunctionCall. * If it's a Variable, the Variable will be returned. * Otherwise the node itself will be returned. * @param node the node to cast * @return node or node as a Function or Variable */ public static IResource asExpression(IResource resource) { if (resource == null) { return(null); } if (resource is INode) { IVariable var = SPINFactory.asVariable(resource); if (var != null) { return(var); } IAggregation aggr = SPINFactory.asAggregation((IResource)resource); if (aggr != null) { return(aggr); } IFunctionCall functionCall = SPINFactory.asFunctionCall((IResource)resource); if (functionCall != null) { return(functionCall); } } return(resource); }
public void Generate(IFunctionCall call) { // если функция - бинарная операция if (call.function.isBinOperation) { Spit("("); Generate(call.arguments.First()); Spit(call.function.name); Generate(call.arguments[1]); Spit(")"); return; } Spit(call.function.name, "("); var args = call.arguments.EmptyIfNull().ToList(); if (!args.Empty()) { Generate(args.FirstOrDefault()); foreach (var arg in args.Skip(1)) { Spit(","); Generate(arg); } } Spit(")"); }
public VBinaryOp(IFunctionCall functionCall) : this(functionCall.function) { firstArg = VElementBuilder.Create(functionCall.arguments.FirstOrDefault()); SetFirstArg(firstArg); secondArg = VElementBuilder.Create(functionCall.arguments.Skip(1).FirstOrDefault()); SetSecondArg(secondArg); UpdateSize(); }
private void printOrderByExpression(ISparqlPrinter sb, IResource node) { // TODO check for real test if (node is INode) { IResource resource = (IResource)node; IFunctionCall call = SPINFactory.asFunctionCall(resource); if (call != null) { sb.print("("); ISparqlPrinter pc = sb.clone(); pc.setNested(true); call.Print(pc); sb.print(")"); return; } } printNestedExpressionString(sb, node, true); }
internal ProcessManager(Process process, InjectionMethod injectionMethod) { Process = process; EnableDebuggerPrivileges(); IsWow64 = GetProcessArchitecture(); Memory = new Memory(process.SafeHandle); Peb = ReadPeb(); Modules = GetModules(); if (injectionMethod == InjectionMethod.CreateThread) { _functionCall = new CreateThread(Memory, process); } else { _functionCall = new HijackThread(Memory, process); } }
public FunCall(IFunctionCall fun) { this._function = fun; }