diff --git a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/NodeTypes.java b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/NodeTypes.java index 049eaebe2..b3404f71c 100644 --- a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/NodeTypes.java +++ b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/NodeTypes.java @@ -98,19 +98,11 @@ languages like Javascript, it is common that we may know the (short-) name was generated. File nodes serve as indices, that is, they allow looking up all elements of the code by file. -For each file, the graph MUST contain exactly one File node. +For each file, the graph CAN contain exactly one File node, if not File nodes +are created as indicated by `FILENAME` property of other nodes. As file nodes are root nodes of abstract syntax tress, they are AstNodes and their order field is set to 0. This is because they have no sibling nodes, -not because they are the first node of the AST. - -Each CPG MUST contain a special file node with name set to -``. This node is a placeholder used in cases where a file cannot be -determined at compile time. As an example, consider external library functions. -As their code is not available on CPG construction, the file name is unknown. - -File nodes MUST NOT be created by the language frontend. Instead, the language -frontend is assumed to fill out the `FILENAME` field wherever possible, -allowing File nodes to be created automatically upon first loading the CPG. */ +not because they are the first node of the AST. */ public static final String FILE = "FILE"; /** Finding nodes may be used to store analysis results in the graph diff --git a/schema/src/main/scala/io/shiftleft/codepropertygraph/schema/FileSystem.scala b/schema/src/main/scala/io/shiftleft/codepropertygraph/schema/FileSystem.scala index ceb159dab..39e4f3786 100644 --- a/schema/src/main/scala/io/shiftleft/codepropertygraph/schema/FileSystem.scala +++ b/schema/src/main/scala/io/shiftleft/codepropertygraph/schema/FileSystem.scala @@ -97,19 +97,11 @@ object FileSystem extends SchemaBase { |was generated. File nodes serve as indices, that is, they allow looking up all |elements of the code by file. | - |For each file, the graph MUST contain exactly one File node. + |For each file, the graph CAN contain exactly one File node, if not File nodes + |are created as indicated by `FILENAME` property of other nodes. |As file nodes are root nodes of abstract syntax tress, they are AstNodes and |their order field is set to 0. This is because they have no sibling nodes, |not because they are the first node of the AST. - | - |Each CPG MUST contain a special file node with name set to - |``. This node is a placeholder used in cases where a file cannot be - |determined at compile time. As an example, consider external library functions. - |As their code is not available on CPG construction, the file name is unknown. - | - |File nodes MUST NOT be created by the language frontend. Instead, the language - |frontend is assumed to fill out the `FILENAME` field wherever possible, - |allowing File nodes to be created automatically upon first loading the CPG. |""".stripMargin ) .protoId(38)