Skip to content

Instantly share code, notes, and snippets.

@MikeCodesDotNET
Created May 11, 2020 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeCodesDotNET/b183eebe841d5e057c2f253c5a6edb08 to your computer and use it in GitHub Desktop.
Save MikeCodesDotNET/b183eebe841d5e057c2f253c5a6edb08 to your computer and use it in GitHub Desktop.
private Compilation compilation;
private SemanticModel semanticModel;
private CompilationUnitSyntax syntaxRootNode;
// Validation Class Constructor
public ScriptValidator(Script script)
{
compilation = script.GetCompilation();
SyntaxTree syntaxTree = compilation.SyntaxTrees.First();
syntaxRootNode = syntaxTree.GetRoot() as CompilationUnitSyntax;
semanticModel = compilation.GetSemanticModel(compilation.SyntaxTrees.First());
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment