compiler/ast/ast

    Dark Mode
Search:
  Source   Edit

abstract syntax tree + symbol table

Vars

ggDebug: bool
convenience switch for trying out things   Source   Edit

Consts

GrowthFactor = 2
  Source   Edit
StartSize = 8
  Source   Edit

Procs

proc addAllowNil(father, son: Indexable) {.inline.}
  Source   Edit
proc addParam(procType: PType; param: PSym) {....raises: [], tags: [].}
  Source   Edit
proc addSonNilAllowed(father, son: PNode) {....raises: [], tags: [].}
  Source   Edit
proc appendToModule(m: PSym; n: PNode) {....raises: [], tags: [].}
The compiler will use this internally to add nodes that will be appended to the module after the sem pass   Source   Edit
proc assignType(dest, src: PType) {....raises: [], tags: [].}
  Source   Edit
proc copyIdTable(dest: var TIdTable; src: TIdTable) {....raises: [], tags: [].}
  Source   Edit
proc copyNode(src: PNode): PNode {....raises: [KeyError], tags: [].}
  Source   Edit
proc copyNodeWithKids(src: PNode): PNode {....raises: [KeyError], tags: [].}
Creates a shallow copy of src, meaning that a copy of src is created without deep-copying the tree.   Source   Edit
proc copyObjectSet(dest: var TObjectSet; src: TObjectSet) {....raises: [], tags: [].}
  Source   Edit
proc copyStrTable(dest: var TStrTable; src: TStrTable) {....raises: [], tags: [].}
  Source   Edit
proc copySym(s: PSym; id: ItemId): PSym {....raises: [], tags: [].}
  Source   Edit
proc copyTree(src: PNode): PNode {....raises: [KeyError], tags: [].}
  Source   Edit
proc copyTreeWithoutNode(src, skippedNode: PNode): PNode {....raises: [KeyError],
    tags: [].}
  Source   Edit
proc copyTreeWithoutNodes(src: PNode; skippedNodes: varargs[PNode]): PNode {.
    ...raises: [KeyError], tags: [].}
  Source   Edit
proc copyType(t: PType; id: ItemId; owner: PSym): PType {....raises: [], tags: [].}
  Source   Edit
proc createModuleAlias(s: PSym; id: ItemId; newIdent: PIdent; info: TLineInfo;
                       options: TOptions): PSym {....raises: [], tags: [].}
  Source   Edit
proc delSon(father: PNode; idx: int) {....raises: [], tags: [].}
  Source   Edit
proc discardSons(father: PNode) {....raises: [], tags: [].}
  Source   Edit
proc exactReplica(t: PType): PType {....raises: [], tags: [].}
  Source   Edit
proc initIdNodeTable(x: var TIdNodeTable) {....raises: [], tags: [].}
  Source   Edit
proc initIdTable(x: var TIdTable) {....raises: [], tags: [].}
  Source   Edit
proc initNodeTable(x: var TNodeTable) {....raises: [], tags: [].}
  Source   Edit
proc initObjectSet(x: var TObjectSet) {....raises: [], tags: [].}
  Source   Edit
proc initStrTable(x: var TStrTable) {....raises: [], tags: [].}
  Source   Edit
proc isGCedMem(t: PType): bool {.inline, ...raises: [], tags: [].}
  Source   Edit
proc linkTo(s: PSym; t: PType): PSym {.discardable, ...raises: [], tags: [].}
  Source   Edit
proc linkTo(t: PType; s: PSym): PType {.discardable, ...raises: [], tags: [].}
  Source   Edit
proc makeStmtList(n: PNode): PNode {....raises: [], tags: [].}
  Source   Edit
proc newFloatNode(kind: TNodeKind; floatVal: BiggestFloat): PNode {....raises: [],
    tags: [].}
  Source   Edit
proc newIdentNode(ident: PIdent; info: TLineInfo): PNode {....raises: [], tags: [].}
  Source   Edit
proc newIdNodeTable(): TIdNodeTable {....raises: [], tags: [].}
  Source   Edit
proc newIdTable(): TIdTable {....raises: [], tags: [].}
  Source   Edit
proc newIntNode(kind: TNodeKind; intVal: BiggestInt): PNode {....raises: [],
    tags: [].}
  Source   Edit
proc newIntNode(kind: TNodeKind; intVal: Int128): PNode {....raises: [], tags: [].}
  Source   Edit
proc newIntTypeNode(intVal: BiggestInt; typ: PType): PNode {....raises: [],
    tags: [].}
  Source   Edit
proc newIntTypeNode(intVal: Int128; typ: PType): PNode {....raises: [], tags: [].}
  Source   Edit
proc newNode(kind: TNodeKind): PNode {.inline, ...raises: [], tags: [].}
new node with unknown line info, no type, and no children   Source   Edit
func newNodeI(kind: TNodeKind; info: TLineInfo): PNode {.inline, ...raises: [],
    tags: [].}
new node with line info, no type, and no children   Source   Edit
proc newNodeI(kind: TNodeKind; info: TLineInfo; children: int): PNode {.
    ...raises: [], tags: [].}
new node with line info, no type, and children   Source   Edit
proc newNodeIT(kind: TNodeKind; info: TLineInfo; typ: PType): PNode {.
    ...raises: [], tags: [].}
new node with line info, type, and no children   Source   Edit
proc newNodeIT(kind: TNodeKind; info: TLineInfo; typ: PType; children: int): PNode {.
    ...raises: [], tags: [].}
new node with line info, type, and children   Source   Edit
proc newProcNode(kind: TNodeKind; info: TLineInfo; body: PNode; params, name,
    pattern, genericParams, pragmas, exceptions: PNode): PNode {....raises: [],
    tags: [].}
  Source   Edit
proc newProcType(info: TLineInfo; id: ItemId; owner: PSym): PType {....raises: [],
    tags: [].}
  Source   Edit
proc newSons(father: Indexable; length: int)
  Source   Edit
proc newStrNode(kind: TNodeKind; strVal: string): PNode {....raises: [], tags: [].}
  Source   Edit
proc newStrNode(strVal: sink string; typ: PType; info = unknownLineInfo): PNode {.
    ...raises: [], tags: [].}
  Source   Edit
proc newStrNode(strVal: string; info: TLineInfo): PNode {....raises: [], tags: [].}
  Source   Edit
proc newStrTable(): TStrTable {....raises: [], tags: [].}
  Source   Edit
proc newSym(symKind: TSymKind; name: PIdent; id: ItemId; owner: PSym;
            info: TLineInfo; options: TOptions = {}): PSym {.inline, ...raises: [],
    tags: [].}
  Source   Edit
proc newSym(symKind: TSymKind; name: PIdent; id: ItemId; owner: PSym;
            info: TLineInfo; typ: PType; options: TOptions = {}): PSym {.
    ...raises: [], tags: [].}
  Source   Edit
proc newSymNode(sym: PSym): PNode {.inline, ...raises: [], tags: [].}
create a new sym node from sym with its info and type   Source   Edit
proc newSymNode(sym: PSym; info: TLineInfo): PNode {.inline, ...raises: [],
    tags: [].}
create a new sym node from sym with its type and supplied info   Source   Edit
proc newSymNodeIT(sym: PSym; info: TLineInfo; typ: PType): PNode {....raises: [],
    tags: [].}
create a new sym node with the supplied info and typ   Source   Edit
proc newTree(kind: TNodeKind; children: varargs[PNode]): PNode {....raises: [],
    tags: [].}
  Source   Edit
proc newTreeI(kind: TNodeKind; info: TLineInfo; children: varargs[PNode]): PNode {.
    ...raises: [], tags: [].}
  Source   Edit
proc newTreeIT(kind: TNodeKind; info: TLineInfo; typ: PType;
               children: varargs[PNode]): PNode {....raises: [], tags: [].}
  Source   Edit
proc newType(kind: TTypeKind; id: ItemId; owner: PSym): PType {....raises: [],
    tags: [].}
  Source   Edit
proc newTypeError(prev: PType; id: ItemId;
                  owner: PSym = if isNil(prev): nil else: prev.owner; err: PNode): PType {.
    ...raises: [], tags: [].}
create a new error type, with an optional previous type (can be nil) and error node for the error msg   Source   Edit
proc propagateToOwner(owner, elem: PType; propagateHasAsgn = true) {....raises: [],
    tags: [].}
  Source   Edit
proc rawAddSon(father, son: PType; propagateHasAsgn = true) {....raises: [],
    tags: [].}
  Source   Edit
proc rawAddSonNoPropagationOfTypeFlags(father, son: PType) {....raises: [],
    tags: [].}
  Source   Edit
proc resetIdTable(x: var TIdTable) {....raises: [], tags: [].}
  Source   Edit
proc shallowCopy(src: PNode): PNode {....raises: [KeyError], tags: [].}
  Source   Edit
proc splitCustomLit(n: ParsedNode): tuple[num, ident: ParsedNode] {.inline,
    ...raises: [], tags: [].}
  Source   Edit
proc toHumanStr(kind: TSymKind): string {....raises: [], tags: [].}
strips leading sk   Source   Edit
proc toHumanStr(kind: TTypeKind): string {....raises: [], tags: [].}
strips leading tk   Source   Edit
proc toObject(typ: PType): PType {....raises: [], tags: [].}
If typ is a tyRef then its immediate son is returned (which in many cases should be a tyObject). Otherwise typ is simply returned as-is.   Source   Edit
proc toObjectFromRefPtrGeneric(typ: PType): PType {....raises: [], tags: [].}
  Source   Edit
proc toPNode(parsed: ParsedNode): PNode {....raises: [], tags: [].}
  Source   Edit
func toTNodeKind(kind: ParsedNodeKind): TNodeKind {.inline, ...raises: [], tags: [].}
  Source   Edit
proc toVar(typ: PType; kind: TTypeKind; idgen: IdGenerator): PType {....raises: [],
    tags: [].}
If typ is not a tyVar then it is converted into a var <typ> and returned. Otherwise typ is simply returned as-is.   Source   Edit
proc transitionGenericParamToType(s: PSym) {....raises: [], tags: [].}
  Source   Edit
proc transitionIntKind(n: PNode; kind: range[nkCharLit .. nkUInt64Lit]) {.
    ...raises: [], tags: [].}
  Source   Edit
proc transitionNoneToSym(n: PNode) {....raises: [], tags: [].}
  Source   Edit
proc transitionRoutineSymKind(s: PSym; kind: range[skProc .. skTemplate]) {.
    ...raises: [], tags: [].}
  Source   Edit
proc transitionSonsKind(n: PNode; kind: range[nkDotCall .. nkTupleConstr]) {.
    ...raises: [], tags: [].}
  Source   Edit
proc transitionToError(s: PSym; err: PNode) {....raises: [], tags: [].}
transition symbol to an skError with error node   Source   Edit
proc transitionToLet(s: PSym) {....raises: [], tags: [].}
  Source   Edit
proc withInfo(n: PNode; info: TLineInfo): PNode {....raises: [], tags: [].}
set the line information (info) on the node n   Source   Edit

Exports

==, TIdPair, TIdent, tyUserTypeClasses, TObjectSet, sfNoInit, TIdObj, typedescPtrs, TNodeSeq, ==, TIdPairSeq, nkFloatLiterals, PIdent, TTypeSeq, tyMetaTypes, abstractVar, effectListLen, TNodeTable, tfObjHasKids, AstDiagVmTrace, [], TExprFlags, TIdNodePair, ccFastCall, tyPureObject, ctfeWhitelist, ccStdCall, AstDiagKind, TSymFlags, abstractVarRange, AdSemDefNameSymKind, len, TInstantiation, TLibKind, TObjectSeq, ExportableSymKinds, LibId, ccSysCall, nkIntLiterals, sfNoForward, TNodePair, comment, TSymKind, add, nkUIntLiterals, invalidNodeId, AstDiagVmError, typedescInst, TNode, TNodeFlags, EffectsCompat, abstractRange, TIdNodeTable, ccNimCall, comment=, PIdObj, TNodeKind, AdSemDefNameSym, ccInline, sfBase, routineKinds, tyTypeClasses, exceptionEffects, AstDiagVmGenError, TSymKinds, PAstDiag, TNodeKinds, TType, ProcConvMismatch, SemTypeMismatch, tyUnknown, sfExperimental, abstractInst, ccCDecl, TStrTable, tagEffects, ccNoConvention, MismatchKind, TTypeFlags, AstDiagVmKind, CompilesId, TSymFlag, abstractPtrs, GcTypeKinds, TScope, hash, nkWithSons, nkWhen, tyUnknownTypes, sfCustomPragma, setUseIc, ccClosure, TImplication, skError, TSym, sfEscapes, TTypeKind, PNode, nodeKindsProducedByParse, MismatchInfo, nkLastBlockStmts, tfGcSafe, [], TIdNodePairSeq, TPairSeq, $, nkSIntLiterals, NodeId, TNodePairSeq, TCallingConvention, TExprFlag, AstDiagVmGenKind, ccSafeCall, Indexable, TNodeFlag, PSym, SemDiagnostics, TTypeAllowedFlags, maxInstantiation, nkEffectList, nkWithoutSons, skipPtrs, ExternalFlag, TAstDiag, TLockLevel, sfAnon, sfAllUntyped, tyError, eqTypeFlags, TMagic, TTypeKinds, sfDirty, tyBuiltInTypeClasses, SemSpellCandidate, nkLiterals, TLib, ccNoInline, tfReturnsNew, TTypeAllowedFlag, skipForHooks, PInstantiation, nkStrLiterals, pragmasEffects, nkWhenExpr, []=, SemCallMismatch, TTypeRelation, ItemId, TTypeAttachedOp, nkVariableSections, TTypeFlag, ExternalFlags, isNil, PScope, TPair, TIdTable, sfWrittenTo, hash, PType, []=, tfUnion, idGeneratorFromModule, IdGenerator, PackageModuleId, nextSymId, nextTypeId, defaultAlignment, patternPos, isGenericRoutine, branches, canRaiseConservative, skLocalVars, skProcKinds, AttachedOpToMagic, UnspecifiedLockLevel, getPIdent, isErrorLike, nkStrKinds, bodyPos, magicsThatCanRaise, isGenericRoutine, $, getInt, OverloadableSyms, nkAllNodeKinds, skipTypesOrNil, namePos, GenericTypes, callableDefs, skipGenericOwner, paramsPos, NilableTypes, firstArgPos, isError, items, pragmasPos, nkTypeExprs, typeCompleted, getStrOrChar, endsInNoReturn, FakeVarParams, UnknownLockLevel, PersistentNodeFlags, isSinkParam, filename, skipTypes, dispatcherPos, canRaise, ConcreteTypes, id, nkCallKinds, isClosureIterator, StructuralEquivTypes, skipDistincts, skipTypes, isEmptyType, defaultSize, isInlineIterator, defaultOffset, routineDefs, wrongNodePos, isErrorLike, isErrorLike, isError, skipStmtList, safeLen, isAtom, nkPragmaCallKinds, miscPos, isCompileTimeProc, procDefs, declarativeDefs, fileIdx, genericParamsInMacroCall, getInt64, getDeclPragma, isRoutine, getnimblePkgId, isMetaType, NodePosName, hasNilSon, requiredGenericParams, AttachedOpToStr, isGenericParams, skipForDiscardable, resultPos, IntegralTypes, nkFloatKinds, skipColon, errorKindPos, previouslyInferred, getnimblePkg, nkSymChoices, nkLambdaKinds, compilerInfoPos, entityDefs, originatingModule, astdef, isInfixAs, isRunnableExamples, hasDestructor, genericParamsPos, NodeSliceName, lastSon, isOwnedBy, pairs, $, detailedInfo, names, incompleteType, MaxLockLevel, containsNode, isGenericRoutineStrict, requiredParams, isCallExpr, isUnresolvedSym, ConstantDataTypes, hasSubnodeWith, isSinkType, getFloat, nkIntKinds, isClosure, PtrLikeKinds, branchLabels, getStr, skipAddr, forLoopDefs, isUnresolvedStatic, nkIdentKinds, hasSonWith, hasPattern, isError, getIdentLineInfo, [], findUnresolvedStatic, [], bitxor, maskUInt16, <, <=, high, castToUInt64, shr, toHex, ==, +, addInt128, abs, One, <=, inInt128Range, maskUInt64, $, toUInt8, inc, <, +=, maskBytes, Ten, -, -, *=, Zero, toUInt64, ==, -=, toInt64Checked, +, parseDecimalInt128, toInt8, toUInt16, mod, toInt128, shl, maskUInt32, toUInt32, Max, toInt128, toUInt, Int128, <, bitor, <=, -, toFloat64, fastLog2, ==, *=, bitnot, toInt64, NegOne, div, +, *, toInt32, low, addToHex, -, maskUInt8, divMod, bitand, Min, cmp, *, toInt16, toInt, castToInt64