All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.shiftleft.codepropertygraph.generated.Operators Maven / Gradle / Ivy

There is a newer version: 1.7.13
Show newest version
package io.shiftleft.codepropertygraph.generated;

import java.util.HashSet;
import java.util.Set;

public class Operators {


public static final String addition = ".addition";


public static final String subtraction = ".subtraction";


public static final String multiplication = ".multiplication";


public static final String division = ".division";


public static final String exponentiation = ".exponentiation";


public static final String modulo = ".modulo";


public static final String shiftLeft = ".shiftLeft";

/** Shift right padding with zeros */
public static final String logicalShiftRight = ".logicalShiftRight";

/** Shift right preserving the sign */
public static final String arithmeticShiftRight = ".arithmeticShiftRight";


public static final String not = ".not";


public static final String and = ".and";


public static final String or = ".or";


public static final String xor = ".xor";


public static final String assignmentPlus = ".assignmentPlus";


public static final String assignmentMinus = ".assignmentMinus";


public static final String assignmentMultiplication = ".assignmentMultiplication";


public static final String assignmentDivision = ".assignmentDivision";


public static final String assignmentExponentiation = ".assignmentExponentiation";


public static final String assignmentModulo = ".assignmentModulo";


public static final String assignmentShiftLeft = ".assignmentShiftLeft";


public static final String assignmentLogicalShiftRight = ".assignmentLogicalShiftRight";


public static final String assignmentArithmeticShiftRight = ".assignmentArithmeticShiftRight";


public static final String assignmentAnd = ".assignmentAnd";


public static final String assignmentOr = ".assignmentOr";


public static final String assignmentXor = ".assignmentXor";


public static final String arrayInitializer = ".arrayInitializer";


public static final String assignment = ".assignment";

/** E.g. `a = -b` */
public static final String minus = ".minus";

/** E.g. `a = +b` */
public static final String plus = ".plus";


public static final String preIncrement = ".preIncrement";


public static final String preDecrement = ".preDecrement";


public static final String postIncrement = ".postIncrement";


public static final String postDecrement = ".postDecrement";


public static final String logicalNot = ".logicalNot";


public static final String logicalOr = ".logicalOr";


public static final String logicalAnd = ".logicalAnd";


public static final String equals = ".equals";


public static final String notEquals = ".notEquals";


public static final String greaterThan = ".greaterThan";


public static final String lessThan = ".lessThan";


public static final String greaterEqualsThan = ".greaterEqualsThan";


public static final String lessEqualsThan = ".lessEqualsThan";


public static final String instanceOf = ".instanceOf";

/** Deprecated. Formerly in C: `a.b` but not! in Java */
public static final String memberAccess = ".memberAccess";

/** Deprecated. Formerly in C: `a->b` and `a.b` in Java */
public static final String indirectMemberAccess = ".indirectMemberAccess";

/** Deprecated. Formerly in C: `a[b]` but not! in Java */
public static final String computedMemberAccess = ".computedMemberAccess";

/** Deprecated. Formerly in C++: `a->*b` and a[b] in Java */
public static final String indirectComputedMemberAccess = ".indirectComputedMemberAccess";

/** Accesses through a pointer (load/store), i.e. dereferences it. Typically the star-operator in C/C++. Pairs of addressOf and indirection operators cancel each other. Handling of this operator is special-cased in the back-end */
public static final String indirection = ".indirection";

/** Deletes a property from a namespace. E.g. `a=3; delete a; a == undefined; */
public static final String delete = ".delete";

/** E.g. `a ? consequent : alternate`. In future probably also used for if statements */
public static final String conditional = ".conditional";

/** E.g. `x = f() ?: g()`. A binary operator that returns its first operand if that operand evaluates to a true value, and otherwise evaluates and returns its second operand. */
public static final String elvis = ".elvis";

/** Type casts of any sort */
public static final String cast = ".cast";

/** Comparison between two arguments with the results: 0 == equal, negative == left < right, positive == left > right */
public static final String compare = ".compare";

/** Returns the address of a given object. Pairs of addressOf and indirection operators cancel each other. Handling of this operator is special-cased in the back-end */
public static final String addressOf = ".addressOf";

/** Returns the size of a given object */
public static final String sizeOf = ".sizeOf";

/** Returns or sets a field/member of a struct/class. Typically, the dot-operator. In terms of CPG, the first argument is the struct/class and the second argument is either a FIELD_IDENTIFIER node, a LITERAL node or an arbitrary expression. If it is a FIELD_IDENTIFIER, then the string contained in the CANONICAL_NAME field of this FIELD_IDENTIFIER node selects which field/member is accessed. If it is a LITERAL node, then its CODE selects which field/member is selected. In any other case the access is considered unpredictable by the backend, and we overtaint. indexAccess and fieldAccess live in the same space, such that e.g. obj.field and obj["field"] refer to the same target (as is correct in e.g. javascript). Handling of this operator is special-cased in the back-end */
public static final String fieldAccess = ".fieldAccess";

/** Accesses (loads/stores) to a field/member through a pointer to a struct/class. Typically, C/C++ arrow-operator. The field selection works the same way as for fieldAccess. For the sake of data-flow tracking, this is the same as first dereferencing the pointer and then accessing the field. Handling of this operator is special-cased in the back-end */
public static final String indirectFieldAccess = ".indirectFieldAccess";

/** Accesses a container (e.g. array or associative array / dict / map) at an index. The index selection works the same way as for fieldAccess. Handling of this operator is special-cased in the back-end */
public static final String indexAccess = ".indexAccess";

/** Accesses an element of an Array through a pointer. The index selection works similar as for fieldAccess: However, the index must be an integer. If the second argument is a FIELD_ACCESS resp. LITERAL then its CANONICAL_NAME resp. CODE field is parsed as an integer; on parsing failure, the access is considered unpredictable and we overtaint. This is equivalent to a pointerShift followed by an indirection. This operator is currently only used by C-style languages. This behavior allows the backend to infer that ptr[0] and *ptr refer to the same object. Handling of this operator is special-cased in the back-end */
public static final String indirectIndexAccess = ".indirectIndexAccess";

/** Shifts a pointer. In terms of CPG, the first argument is the pointer and the second argument is the index. The index selection works the same way as for indirectIndexAccess. This operator is currently only used directly by the LLVM language, but it is also used internally for C. For example, pointerShift(ptr, 7) is equivalent to &(ptr[7]). Handling of this operator is special-cased in the back-end */
public static final String pointerShift = ".pointerShift";

/** Derives a pointer to a field of a struct from a pointer to the entire struct. This corresponds to the C idiom &(ptr->field), which does not access memory. The field selection works the same way as for fieldAccess. This operator is currently only used directly by the LLVM language. Handling of this operator is special-cased in the back-end */
public static final String getElementPtr = ".getElementPtr";

/** Defines a string literal which can replace containing expressions with their values. */
public static final String formatString = ".formatString";

/** Replaces an expression with its string value. */
public static final String formattedValue = ".formattedValue";

/** Defines a range of values, e.g. `for (i in 1..10) print(i)`. */
public static final String range = ".range";

/** Checks the existence of a variable in a range or collection, e.g. `for (i in 1..10) print(i)`. */
public static final String in = ".in";

/** Checks the non-existence of a variable in a range or collection, e.g. `print(5 not in [1, 2, 3, 4])` */
public static final String notIn = ".notIn";

/** Checks whether a variable is of a given type */
public static final String is = ".is";

/** Checks whether a variable is not of a given type */
public static final String isNot = ".isNot";

/** Converts any value to a not-null type */
public static final String notNullAssert = ".notNullAssert";

/** Returns the length of the given collection e.g. (new int[]{ 1, 2, 3 }).length in Java or len([1, 2, 3]) in Python */
public static final String lengthOf = ".lengthOf";

/** Returns null if the first operator is null, otherwise performs a dereferencing operation */
public static final String safeNavigation = ".safeNavigation";

/** Returns either the last expression in the `try`-block, or the last expression in one of the `catch`/`except`-blocks. The contents of the `finally`-block are ignored. */
public static final String tryCatch = ".tryCatch";

/** Allocates memory for an object of a specific type */
public static final String alloc = ".alloc";

public static Set ALL = new HashSet() {{
add(addition);
add(subtraction);
add(multiplication);
add(division);
add(exponentiation);
add(modulo);
add(shiftLeft);
add(logicalShiftRight);
add(arithmeticShiftRight);
add(not);
add(and);
add(or);
add(xor);
add(assignmentPlus);
add(assignmentMinus);
add(assignmentMultiplication);
add(assignmentDivision);
add(assignmentExponentiation);
add(assignmentModulo);
add(assignmentShiftLeft);
add(assignmentLogicalShiftRight);
add(assignmentArithmeticShiftRight);
add(assignmentAnd);
add(assignmentOr);
add(assignmentXor);
add(arrayInitializer);
add(assignment);
add(minus);
add(plus);
add(preIncrement);
add(preDecrement);
add(postIncrement);
add(postDecrement);
add(logicalNot);
add(logicalOr);
add(logicalAnd);
add(equals);
add(notEquals);
add(greaterThan);
add(lessThan);
add(greaterEqualsThan);
add(lessEqualsThan);
add(instanceOf);
add(memberAccess);
add(indirectMemberAccess);
add(computedMemberAccess);
add(indirectComputedMemberAccess);
add(indirection);
add(delete);
add(conditional);
add(elvis);
add(cast);
add(compare);
add(addressOf);
add(sizeOf);
add(fieldAccess);
add(indirectFieldAccess);
add(indexAccess);
add(indirectIndexAccess);
add(pointerShift);
add(getElementPtr);
add(formatString);
add(formattedValue);
add(range);
add(in);
add(notIn);
add(is);
add(isNot);
add(notNullAssert);
add(lengthOf);
add(safeNavigation);
add(tryCatch);
add(alloc);
}};

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy