Table of Contents

Class CSharpParser

Namespace
SunamoDevCode
Assembly
SunamoDevCode.dll

Parser for C# code, specifically for handling const declarations.

public class CSharpParser
Inheritance
CSharpParser
Inherited Members
Extension Methods

Fields

PublicModifier

Public modifier keyword with trailing space.

public const string PublicModifier = "public "

Field Value

string

StaticReadonlyModifier

Static readonly modifier keywords with trailing space.

public const string StaticReadonlyModifier = "static readonly "

Field Value

string

Methods

ParseConsts(List<string>, out int)

Parses const declarations from lines, tracking the first occurrence index.

public static List<string> ParseConsts(List<string> lines, out int first)

Parameters

lines List<string>

Lines of C# code to parse.

first int

Output parameter for the index of the first const declaration found.

Returns

List<string>

List of const keys found in the lines.

ParseConstsAllLines(List<string>)

Parses const declarations from all lines without filtering.

public static List<string> ParseConstsAllLines(List<string> lines)

Parameters

lines List<string>

Lines of C# code to parse.

Returns

List<string>

List of const keys found in the lines.

RemoveConsts(string, List<string>)

Directly save to file In A2 will be what can't be deleted, when will be > 0, ThrowException

public static Task RemoveConsts(string file, List<string> remove)

Parameters

file string
remove List<string>

Returns

Task