Click or drag to resize

CSharpParser Class

Very light parser for C# code. The main purpose of it is to be very fast and reliable. It only extracts code information relative to the CS-Script.
Inheritance Hierarchy
SystemObject
  CSScriptLibCSharpParser

Namespace:  CSScriptLib
Assembly:  CSScriptLib (in CSScriptLib.dll) Version: 1.3.2.0
Syntax
C#
public class CSharpParser

The CSharpParser type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyArgs
Embedded script arguments. The both script and engine arguments are allowed except "/noconfig" engine command line switch.
Public propertyCmdScripts
Pre- and post-execution scripts.
Public propertyCode
Script C# raw code.
Public propertyCompilerOptions
Embedded compiler options.
Public propertyExtraSearchDirs
Additional search directories (for script and assembly probing).
Public propertyHostOptions
Embedded compiler options.
Public propertyIgnoreNamespaces
Names of namespaces to be ignored by namespace-to-assembly resolver.
Public propertyImports
C# scripts to be imported.
Public propertyInits
Script initialization directives.
Public propertyModifiedCode
Script C# code after namespace renaming.
Public propertyNuGets
References to the NuGet packages.
Public propertyPrecompilers
Precompilers.
Public propertyRefAssemblies
References to the external assemblies.
Public propertyReferences
References to the external assemblies and namespaces.
Public propertyRefNamespaces
References to the namespaces.
Public propertyResFiles
References to the resource files.
Top
Methods
  NameDescription
Public methodDoRenaming
Renames namespaces according renaming instructions.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodStatic memberEscapeDirectiveDelimiters
Escapes the CS-Script directive (e.g. //css_*) delimiters.

All //css_* directives should escape any internal CS-Script delimiters by doubling the delimiter character. For example //css_include for 'script(today).cs' should escape brackets as they are the directive delimiters. The correct syntax would be as follows '//css_include script((today)).cs;'

Remarks
The delimiters characters are ';,(){}'.

However you should check DirectiveDelimiters for the accurate list of all delimiters.

Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodStatic memberUnescapeDirectiveDelimiters
Unescapes the CS-Script directive (e.g. //css_*) delimiters.

All //css_* directives should escape any internal CS-Script delimiters by doubling the delimiter character. For example //css_include for 'script(today).cs' should escape brackets as they are the directive delimiters. The correct syntax would be as follows '//css_include script((today)).cs;'

Remarks
The delimiters characters are ';,(){}'.

However you should check DirectiveDelimiters for the accurate list of all delimiters.

Top
Fields
  NameDescription
Public fieldCustomDirectives
The result of search for additional C# script directives to search (directive vs. value).
Public fieldStatic memberDirectiveDelimiters
The //css_* directive delimiters.
Remarks
All //css_* directives should escape any internal CS-Script delimiters by doubling the delimiter character. For example //css_include for 'script(today).cs' should escape brackets as they are the directive delimiters. The correct syntax would be as follows '//css_include script((today)).cs;'
Public fieldStatic memberOpenEndDirectiveSyntax
Enables omitting closing character (";") for CS-Script directives (e.g. "//css_ref System.Xml.dll" instead of "//css_ref System.Xml.dll;").
Public fieldStatic memberSupressCodeAnalysis
Global flag to forcefuly supress any C# code analysys. This flag efectively disables all CS-Script assembly and script probing and most likely some other functionality.

You may ever want to suppress code analysis only for profiling purposes or during performance tuning.

Top
See Also