You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For new research projects, we have to abstract from software projects to be able to compare variants and their code fragments.
Therefore, as a first step we want to represent projects and software artefacts in a tree structure.
The following is a first draft for how such an abstract syntax tree (AST) structure could look like:
classAST<Grammar, Value> {
intUUID;
Grammartype;
Valuevalue;
List<AST<Grammar, Value>> children = newArrayList<>();
/// getters, setters, and utility methods here
}
where a Grammar would be an enum over grammar symbols of for example Java or C++ grammar.
The grammar, this describes the type of a node in the tree.
For now, the goal is to stick to a line-based structure such as used in git diff.
Thus, an initial grammar would be:
publicenumLineGrammar {
Directory, File, Line
}
Thus, we would distinguish between directories, files and lines of source code in that file.
For example, the following would be the way to construct a tree for a java Hello World program manually:
For new research projects, we have to abstract from software projects to be able to compare variants and their code fragments.
Therefore, as a first step we want to represent projects and software artefacts in a tree structure.
The following is a first draft for how such an abstract syntax tree (AST) structure could look like:
where a
Grammar
would be an enum over grammar symbols of for example Java or C++ grammar.The grammar, this describes the type of a node in the tree.
For now, the goal is to stick to a line-based structure such as used in
git diff
.Thus, an initial grammar would be:
Thus, we would distinguish between directories, files and lines of source code in that file.
For example, the following would be the way to construct a tree for a java
Hello World
program manually:This tree structure should be part of the VariantSyncCoreLibrary from issue #49.
The text was updated successfully, but these errors were encountered: