diff --git a/PSI/Reference/RegExp/Manipulation.md b/PSI/Reference/RegExp/Manipulation.md new file mode 100644 index 00000000..93cbb3e9 --- /dev/null +++ b/PSI/Reference/RegExp/Manipulation.md @@ -0,0 +1 @@ +# Manipulating the Tree diff --git a/PSI/Reference/RegExp/Navigators.md b/PSI/Reference/RegExp/Navigators.md new file mode 100644 index 00000000..85cb6d38 --- /dev/null +++ b/PSI/Reference/RegExp/Navigators.md @@ -0,0 +1,258 @@ +# Navigators + + + + + + +## C + +### ConcatenationRegularExpressionNavigator + + + +```cs +public static class ConcatenationRegularExpressionNavigator +{ + public static IConcatenationRegularExpression GetByUnitRegularExpression(IUnitRegularExpression param); +} +``` + +* See also: [IConcatenationRegularExpression](TreeNodesA-N.md#iconcatenationregularexpression), [IUnitRegularExpression](TreeNodesO-Z.md#iunitregularexpression) + + + +## G + +### GroupNameNavigator + + + +```cs +public static class GroupNameNavigator +{ + public static IGroupName GetByName(IName param); + public static IGroupName GetBySecondaryName(IName param); +} +``` + +* See also: [IGroupName](TreeNodesA-N.md#igroupname), [IName](TreeNodesA-N.md#iname) + + + +## N + +### NamedBackreferenceNavigator + + + +```cs +public static class NamedBackreferenceNavigator +{ + public static INamedBackreference GetByName(IName param); +} +``` + +* See also: [IName](TreeNodesA-N.md#iname), [INamedBackreference](TreeNodesA-N.md#inamedbackreference) + + + +### NamedBlockNavigator + + + +```cs +public static class NamedBlockNavigator +{ + public static INamedBlock GetByName(IName param); +} +``` + +* See also: [IName](TreeNodesA-N.md#iname), [INamedBlock](TreeNodesA-N.md#inamedblock) + + + +### NamedGroupNavigator + + + +```cs +public static class NamedGroupNavigator +{ + public static INamedGroup GetByGroupName(IGroupName param); + public static INamedGroup GetByRegularExpression(IRegularExpression param); +} +``` + +* See also: [IGroupName](TreeNodesA-N.md#igroupname), [INamedGroup](TreeNodesA-N.md#inamedgroup), [IRegularExpression](TreeNodesO-Z.md#iregularexpression) + + + +### NestedSetNavigator + + + +```cs +public static class NestedSetNavigator +{ + public static INestedSet GetByInnerSet(ISet param); +} +``` + +* See also: [INestedSet](TreeNodesA-N.md#inestedset), [ISet](TreeNodesO-Z.md#iset) + + + +### NumericQuantifierNavigator + + + +```cs +public static class NumericQuantifierNavigator +{ + public static INumericQuantifier GetByNumber(INumber param); + public static INumericQuantifier GetBySecondaryNumber(INumber param); +} +``` + +* See also: [INumber](TreeNodesA-N.md#inumber), [INumericQuantifier](TreeNodesA-N.md#inumericquantifier) + + + +## O + +### OptionGroupNavigator + + + +```cs +public static class OptionGroupNavigator +{ + public static IOptionGroup GetByRegularExpression(IRegularExpression param); +} +``` + +* See also: [IOptionGroup](TreeNodesO-Z.md#ioptiongroup), [IRegularExpression](TreeNodesO-Z.md#iregularexpression) + + + +## P + +### PrefixGroupNavigator + + + +```cs +public static class PrefixGroupNavigator +{ + public static IPrefixGroup GetByPrefix(IGroupPrefix param); + public static IPrefixGroup GetByRegularExpression(IRegularExpression param); +} +``` + +* See also: [IGroupPrefix](TreeNodesA-N.md#igroupprefix), [IPrefixGroup](TreeNodesO-Z.md#iprefixgroup), [IRegularExpression](TreeNodesO-Z.md#iregularexpression) + + + +## Q + +### QuantifiableRegularExpressionNavigator + + + +```cs +public static class QuantifiableRegularExpressionNavigator +{ + public static IQuantifiableRegularExpression GetByOwner(IQuantifierOwner param); + public static IQuantifiableRegularExpression GetByQuantifier(IQuantifier param); +} +``` + +* See also: [IQuantifiableRegularExpression](TreeNodesO-Z.md#iquantifiableregularexpression), [IQuantifier](TreeNodesO-Z.md#iquantifier), [IQuantifierOwner](TreeNodesO-Z.md#iquantifierowner) + + + +### QuantifierNavigator + + + +```cs +public static class QuantifierNavigator +{ + public static IQuantifier GetByNumeric(INumericQuantifier param); +} +``` + +* See also: [INumericQuantifier](TreeNodesA-N.md#inumericquantifier), [IQuantifier](TreeNodesO-Z.md#iquantifier) + + + +## R + +### RegularExpressionFileNavigator + + + +```cs +public static class RegularExpressionFileNavigator +{ + public static IRegularExpressionFile GetByRegularExpression(IRegularExpression param); +} +``` + +* See also: [IRegularExpression](TreeNodesO-Z.md#iregularexpression), [IRegularExpressionFile](TreeNodesO-Z.md#iregularexpressionfile) + + + +### RegularExpressionNavigator + + + +```cs +public static class RegularExpressionNavigator +{ + public static IRegularExpression GetByConcatenationRegularExpression(IConcatenationRegularExpression param); +} +``` + +* See also: [IConcatenationRegularExpression](TreeNodesA-N.md#iconcatenationregularexpression), [IRegularExpression](TreeNodesO-Z.md#iregularexpression) + + + +## S + +### SetNavigator + + + +```cs +public static class SetNavigator +{ + public static ISet GetByBody(ISetBody param); +} +``` + +* See also: [ISet](TreeNodesO-Z.md#iset), [ISetBody](TreeNodesO-Z.md#isetbody) + + + +### SetRangeNavigator + + + +```cs +public static class SetRangeNavigator +{ + public static ISetRange GetByMax(ISetRangeItem param); + public static ISetRange GetByMin(ISetRangeItem param); +} +``` + +* See also: [ISetRange](TreeNodesO-Z.md#isetrange), [ISetRangeItem](TreeNodesO-Z.md#isetrangeitem) + + + + + + + diff --git a/PSI/Reference/RegExp/Overview.md b/PSI/Reference/RegExp/Overview.md new file mode 100644 index 00000000..07dd0c5c --- /dev/null +++ b/PSI/Reference/RegExp/Overview.md @@ -0,0 +1 @@ +# Overview diff --git a/PSI/Reference/RegExp/TreeNodesA-N.md b/PSI/Reference/RegExp/TreeNodesA-N.md new file mode 100644 index 00000000..087ec300 --- /dev/null +++ b/PSI/Reference/RegExp/TreeNodesA-N.md @@ -0,0 +1,399 @@ +# TreeNodes A - N + + + + + + +## A + +### IAlternationGroup + + + +```cs +public interface IAlternationGroup : + IGroup, + IQuantifierOwner, + IRegExpTreeNode, + ITreeNode +{ + ITokenNode AltLParenth { get; } + ITokenNode AltRParenth { get; } + ITokenNode LongPrefix { get; } + ITokenNode Pipe { get; } + ITokenNode Prefix { get; } + ITokenNode QuestionSign { get; } +} +``` + +* See also: [IGroup](TreeNodesA-N.md#igroup), [IQuantifierOwner](TreeNodesO-Z.md#iquantifierowner), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +### IAnchor + + + +```cs +public interface IAnchor : + IUnitRegularExpression, + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [IUnitRegularExpression](TreeNodesO-Z.md#iunitregularexpression) + + + +## B + +### IBorderAnchor + + + +```cs +public interface IBorderAnchor : + IAnchor, + IUnitRegularExpression, + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [IAnchor](TreeNodesA-N.md#ianchor), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [IUnitRegularExpression](TreeNodesO-Z.md#iunitregularexpression) + + + +### IBracketCharacter + + + +```cs +public interface IBracketCharacter : + ICharacter, + IQuantifierOwner, + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [ICharacter](TreeNodesA-N.md#icharacter), [IQuantifierOwner](TreeNodesO-Z.md#iquantifierowner), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +## C + +### ICharacter + + + +```cs +public interface ICharacter : + IQuantifierOwner, + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [IQuantifierOwner](TreeNodesO-Z.md#iquantifierowner), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +### IConcatenationRegularExpression + + + +```cs +public interface IConcatenationRegularExpression : + IRegExpTreeNode, + ITreeNode +{ + TreeNodeCollection UnitRegularExpressions { get; } + TreeNodeEnumerable UnitRegularExpressionsEnumerable { get; } +} +``` + +* See also: [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [IUnitRegularExpression](TreeNodesO-Z.md#iunitregularexpression) + + + + +## E + +### IEndAnchor + + + +```cs +public interface IEndAnchor : + IAnchor, + IUnitRegularExpression, + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [IAnchor](TreeNodesA-N.md#ianchor), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [IUnitRegularExpression](TreeNodesO-Z.md#iunitregularexpression) + + + +### IEscapeCharacter + + + +```cs +public interface IEscapeCharacter : + ICharacter, + IQuantifierOwner, + ISetBodyCharacter, + ISetBodyItem, + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [ICharacter](TreeNodesA-N.md#icharacter), [IQuantifierOwner](TreeNodesO-Z.md#iquantifierowner), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [ISetBodyCharacter](TreeNodesO-Z.md#isetbodycharacter), [ISetBodyItem](TreeNodesO-Z.md#isetbodyitem) + + + +## G + +### IGroup + + + +```cs +public interface IGroup : + IQuantifierOwner, + IRegExpTreeNode, + ITreeNode +{ + ITokenNode LParenth { get; } + ITokenNode RParenth { get; } +} +``` + +* See also: [IQuantifierOwner](TreeNodesO-Z.md#iquantifierowner), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +### IGroupName + + + +```cs +public interface IGroupName : + IRegExpTreeNode, + ITreeNode +{ + ITokenNode Dash { get; } + ITokenNode Gt { get; } + ITokenNode Lt { get; } + IName Name { get; } + IName SecondaryName { get; } + + IName SetName(IName param); + IName SetSecondaryName(IName param); +} +``` + +* See also: [IName](TreeNodesA-N.md#iname), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +### IGroupPrefix + + + +```cs +public interface IGroupPrefix : + IRegExpTreeNode, + ITreeNode +{ + ITokenNode LongPrefix { get; } + ITokenNode Lt { get; } + ITokenNode Prefix { get; } +} +``` + +* See also: [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + + +## I + +### IInvalidCharacter + + + +```cs +public interface IInvalidCharacter : + IErrorElement, + ICharacter, + IQuantifierOwner, + ISetBodyCharacter, + ISetBodyItem, + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [ICharacter](TreeNodesA-N.md#icharacter), [IQuantifierOwner](TreeNodesO-Z.md#iquantifierowner), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [ISetBodyCharacter](TreeNodesO-Z.md#isetbodycharacter), [ISetBodyItem](TreeNodesO-Z.md#isetbodyitem) + + + +## N + +### IName + + + +```cs +public interface IName : + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +### INamedBackreference + + + +```cs +public interface INamedBackreference : + IRegExpTreeNode, + ITreeNode +{ + ITokenNode Gt { get; } + ITokenNode Lt { get; } + IName Name { get; } + + IName SetName(IName param); +} +``` + +* See also: [IName](TreeNodesA-N.md#iname), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +### INamedBlock + + + +```cs +public interface INamedBlock : + IRegExpTreeNode, + ITreeNode +{ + ITokenNode LBrace { get; } + IName Name { get; } + ITokenNode RBrace { get; } + + IName SetName(IName param); +} +``` + +* See also: [IName](TreeNodesA-N.md#iname), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +### INamedGroup + + + +```cs +public interface INamedGroup : + IGroup, + IQuantifierOwner, + IRegExpTreeNode, + ITreeNode +{ + IGroupName GroupName { get; } + ITokenNode QuestionSign { get; } + IRegularExpression RegularExpression { get; } + + IGroupName SetGroupName(IGroupName param); + IRegularExpression SetRegularExpression(IRegularExpression param); +} +``` + +* See also: [IGroup](TreeNodesA-N.md#igroup), [IGroupName](TreeNodesA-N.md#igroupname), [IQuantifierOwner](TreeNodesO-Z.md#iquantifierowner), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [IRegularExpression](TreeNodesO-Z.md#iregularexpression) + + + +### INestedSet + + + +```cs +public interface INestedSet : + ISetBodyItem, + IRegExpTreeNode, + ITreeNode +{ + ITokenNode Dash { get; } + ISet InnerSet { get; } + + ISet SetInnerSet(ISet param); +} +``` + +* See also: [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [ISet](TreeNodesO-Z.md#iset), [ISetBodyItem](TreeNodesO-Z.md#isetbodyitem) + + + +### INumber + + + +```cs +public interface INumber : + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +### INumericQuantifier + + + +```cs +public interface INumericQuantifier : + IRegExpTreeNode, + ITreeNode +{ + ITokenNode Comma { get; } + ITokenNode LBrace { get; } + INumber Number { get; } + ITokenNode RBrace { get; } + INumber SecondaryNumber { get; } + + INumber SetNumber(INumber param); + INumber SetSecondaryNumber(INumber param); +} +``` + +* See also: [INumber](TreeNodesA-N.md#inumber), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + diff --git a/PSI/Reference/RegExp/TreeNodesO-Z.md b/PSI/Reference/RegExp/TreeNodesO-Z.md new file mode 100644 index 00000000..3be71a4a --- /dev/null +++ b/PSI/Reference/RegExp/TreeNodesO-Z.md @@ -0,0 +1,410 @@ +# TreeNodes O - Z + + + + + + +## O + +### IOptionGroup + + + +```cs +public interface IOptionGroup : + IGroup, + IQuantifierOwner, + IRegExpTreeNode, + ITreeNode +{ + ITokenNode Colon { get; } + ITokenNode Dash { get; } + TreeNodeCollection Options { get; } + TreeNodeEnumerable OptionsEnumerable { get; } + ITokenNode QuestionSign { get; } + IRegularExpression RegularExpression { get; } + + IRegularExpression SetRegularExpression(IRegularExpression param); +} +``` + +* See also: [IGroup](TreeNodesA-N.md#igroup), [IQuantifierOwner](TreeNodesO-Z.md#iquantifierowner), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [IRegularExpression](TreeNodesO-Z.md#iregularexpression) + + + +## Q + +### IPrefixGroup + + + +```cs +public interface IPrefixGroup : + IGroup, + IQuantifierOwner, + IRegExpTreeNode, + ITreeNode +{ + IGroupPrefix Prefix { get; } + ITokenNode QuestionSign { get; } + IRegularExpression RegularExpression { get; } + + IGroupPrefix SetPrefix(IGroupPrefix param); + IRegularExpression SetRegularExpression(IRegularExpression param); +} +``` + +* See also: [IGroup](TreeNodesA-N.md#igroup), [IGroupPrefix](TreeNodesA-N.md#igroupprefix), [IQuantifierOwner](TreeNodesO-Z.md#iquantifierowner), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [IRegularExpression](TreeNodesO-Z.md#iregularexpression) + + + +### IQuantifiableRegularExpression + + + +```cs +public interface IQuantifiableRegularExpression : + IUnitRegularExpression, + IRegExpTreeNode, + ITreeNode +{ + IQuantifierOwner Owner { get; } + IQuantifier Quantifier { get; } + + IQuantifierOwner SetOwner(IQuantifierOwner param); + IQuantifier SetQuantifier(IQuantifier param); +} +``` + +* See also: [IQuantifier](TreeNodesO-Z.md#iquantifier), [IQuantifierOwner](TreeNodesO-Z.md#iquantifierowner), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [IUnitRegularExpression](TreeNodesO-Z.md#iunitregularexpression) + + + +### IQuantifier + + + +```cs +public interface IQuantifier : + IRegExpTreeNode, + ITreeNode +{ + INumericQuantifier Numeric { get; } + ITokenNode OptionalQuestion { get; } + ITokenNode Plus { get; } + ITokenNode Question { get; } + ITokenNode Star { get; } + + INumericQuantifier SetNumeric(INumericQuantifier param); +} +``` + +* See also: [INumericQuantifier](TreeNodesA-N.md#inumericquantifier), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +### IQuantifierOwner + + + +```cs +public interface IQuantifierOwner : + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +## R + +### IRegExpTokenNode + + + +```cs +public interface IRegExpTokenNode : + IRegExpTreeNode, + ITokenNode, + ITreeNode +{ +} +``` + +* See also: [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +### IRegExpTreeNode + + + +```cs +public interface IRegExpTreeNode : + ITreeNode +{ + void Accept(TreeNodeVisitor visitor); + void Accept(TreeNodeVisitor visitor, TContext context); + TReturn Accept(TreeNodeVisitor visitor, TContext context); +} +``` + + + +### IRegularCharacter + + + +```cs +public interface IRegularCharacter : + ICharacter, + IQuantifierOwner, + ISetBodyCharacter, + ISetBodyItem, + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [ICharacter](TreeNodesA-N.md#icharacter), [IQuantifierOwner](TreeNodesO-Z.md#iquantifierowner), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [ISetBodyCharacter](TreeNodesO-Z.md#isetbodycharacter), [ISetBodyItem](TreeNodesO-Z.md#isetbodyitem) + + + +### IRegularExpression + + + +```cs +public interface IRegularExpression : + IRegExpTreeNode, + ITreeNode +{ + TreeNodeCollection ConcatenationRegularExpressions { get; } + TreeNodeEnumerable ConcatenationRegularExpressionsEnumerable { get; } + TreeNodeCollection Pipes { get; } + TreeNodeEnumerable PipesEnumerable { get; } +} +``` + +* See also: [IConcatenationRegularExpression](TreeNodesA-N.md#iconcatenationregularexpression), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +### IRegularExpressionFile + + + +```cs +public interface IRegularExpressionFile : + IFile, + IRegExpTreeNode, + ITreeNode +{ + IRegularExpression RegularExpression { get; } + + IRegularExpression SetRegularExpression(IRegularExpression param); +} +``` + +* See also: [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [IRegularExpression](TreeNodesO-Z.md#iregularexpression) + + + +## S + +### ISet + + + +```cs +public interface ISet : + IQuantifierOwner, + IRegExpTreeNode, + ITreeNode +{ + ISetBody Body { get; } + ITokenNode LBracket { get; } + ITokenNode NegativeMark { get; } + ITokenNode RBracket { get; } + + ISetBody SetBody(ISetBody param); +} +``` + +* See also: [IQuantifierOwner](TreeNodesO-Z.md#iquantifierowner), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [ISetBody](TreeNodesO-Z.md#isetbody) + + + +### ISetBody + + + +```cs +public interface ISetBody : + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +### ISetBodyCharacter + + + +```cs +public interface ISetBodyCharacter : + ISetBodyItem, + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [ISetBodyItem](TreeNodesO-Z.md#isetbodyitem) + + + +### ISetBodyItem + + + +```cs +public interface ISetBodyItem : + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +### ISetCharacter + + + +```cs +public interface ISetCharacter : + ISetBodyCharacter, + ISetBodyItem, + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [ISetBodyCharacter](TreeNodesO-Z.md#isetbodycharacter), [ISetBodyItem](TreeNodesO-Z.md#isetbodyitem) + + + +### ISetRange + + + +```cs +public interface ISetRange : + ISetBodyItem, + IRegExpTreeNode, + ITreeNode +{ + ITokenNode Dash { get; } + ISetRangeItem Max { get; } + ISetRangeItem Min { get; } + + ISetRangeItem SetMax(ISetRangeItem param); + ISetRangeItem SetMin(ISetRangeItem param); +} +``` + +* See also: [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [ISetBodyItem](TreeNodesO-Z.md#isetbodyitem), [ISetRangeItem](TreeNodesO-Z.md#isetrangeitem) + + + +### ISetRangeItem + + + +```cs +public interface ISetRangeItem : + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode) + + + +### ISimpleGroup + + + +```cs +public interface ISimpleGroup : + IGroup, + IQuantifierOwner, + IRegExpTreeNode, + ITreeNode +{ + IRegularExpression RegularExpression { get; } + + IRegularExpression SetRegularExpression(IRegularExpression param); +} +``` + +* See also: [IGroup](TreeNodesA-N.md#igroup), [IQuantifierOwner](TreeNodesO-Z.md#iquantifierowner), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [IRegularExpression](TreeNodesO-Z.md#iregularexpression) + + + +### IStartAnchor + + + +```cs +public interface IStartAnchor : + IAnchor, + IUnitRegularExpression, + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [IAnchor](TreeNodesA-N.md#ianchor), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [IUnitRegularExpression](TreeNodesO-Z.md#iunitregularexpression) + + + +### ISymbolCharacter + + + +```cs +public interface ISymbolCharacter : + ICharacter, + IQuantifierOwner, + ISetBodyCharacter, + ISetBodyItem, + IRegExpTreeNode, + ITreeNode +{ +} +``` + +* See also: [ICharacter](TreeNodesA-N.md#icharacter), [IQuantifierOwner](TreeNodesO-Z.md#iquantifierowner), [IRegExpTreeNode](TreeNodesO-Z.md#iregexptreenode), [ISetBodyCharacter](TreeNodesO-Z.md#isetbodycharacter), [ISetBodyItem](TreeNodesO-Z.md#isetbodyitem) + + + + + + diff --git a/PSI/Reference/readme.md b/PSI/Reference/readme.md new file mode 100644 index 00000000..987273d6 --- /dev/null +++ b/PSI/Reference/readme.md @@ -0,0 +1,100 @@ +# PSI Reference + +> **NOTE** This is not intended to be part of the compiled documentation! + +The files in these folders are generated semi-automatically. The PsiDocs2 program (not included in the repo yet, speak to Matt Ellis) will create and try to update the files. The process is: + +* The program uses Mono.Cecil to load the assembly containing the PSI implementation +* It finds types: + * Tree nodes - all interfaces deriving from `ITreeNode`. + * Navigators - all classes with a name that ends `Navigator`. + * Utility classes and extension methods - all classes with a name ending `Util`, `Extension` or `Extensions`. + * Element factories - all types where the type name contains `ElementFactory` or `NodeFactory`, but doesn't end in `Extension` or `Extensions`. +* It then creates or updates a type index file for each category of type. +* Finally, any types listed in any file in the output directory are updated. + +## Generating type index files + +The program will first look to see if any files exist for the given category. For example, when creating the type index for tree nodes, the program will check to see if any `TreeNodes*.md` files already exist. This will pick up the type index if it's concatenated into a single file, or if it's split across multiple files. + +If the files do not exist, they are created. The types are grouped alphabetically (if all types are interfaces, the leading 'I' is stripped). There is some logic to try and balance the number of files with the size of the files, but by default, the types are grouped in files such as: + +* `TreeNodesA-D.md` +* `TreeNodesE-H.md` +* `TreeNodesI-L.md` +* `TreeNodesM-P.md` +* `TreeNodesQ-T.md` +* `TreeNodesU-Z.md` + +The file is initially created as "auto-indexed", which means that when it's updated with a new version of the PSI, any missing types are automatically added in the appropriate place. This is done by adding the following HTML comment to the top of the file: + +``` + +``` + +The file then adds the `` table of contents macro used by the [gitbook-plugin-toc](https://github.com/whzhyh/gitbook-plugin-toc) GitBook plugin. + +Each letter in the index then gets a new heading, and each type definition is added in between the special HTML comments `` and ``. These comments are used when updating the content. + +## Updating type index files + +If the index files already exist, they need to be updated, in order to ensure that they contain only the required types, and that the type definition itself is up to date. Each file is processed, looking for the auto-index comment (see above). If this comment is found, the letters after the word "Index" are used to indicate that this file contains types beginning with those letters (again, interaces have the leading 'I' removed, only if *all* types are interfaces, e.g. tree nodes). + +If the auto-index comment is missing, the app will create a new file called `{Type}-missing.md` (e.g. `TreeNodes-missing.md`). This file will contain a list of types that are missing from the other files. They will be correctly formatted, and should be manually copy-and-pasted to the appropriate place. + +Each file is now processed. Auto-indexed files will automatically have new types added, and any types that no longer exist are removed, even for non-auto-indexed files. When adding a type, a new section is added, with header, HTML comments and the type definition. When removing a type, the whole section is removed, including header, HTML comments, type definitions and *any* other content up to the next section. Please make sure to review changes before committing! + +## Updating content + +Finally, the program will update the content in all `*.md` files in the output directory, not just the index files created. This includes hand-crafted files such as `Overview.md`. It will process all `*.md` files in the output directory and look for specially formatted HTML comments, that gives the name of the type that should be output between the comments. + +For example, the content: + +``` + + +``` + +will be replaced with: + +``` + +public interface ICSharpTreeNode : ITreeNode +{ + // Snipped for brevity +} + +``` + +As long as the type is recognised from the list of types processed from the PSI assembly, it will be output. If the type is not recognised, an error is written to `stdout` and should be investigated. + +## Adding a new language + +To add a new language: + +* Add a new folder for the language +* Run the PsiDocs2 app on the PSI assembly and output to this language folder +* Do a manual clean up + * Combine index files that are too short, or don't have enough entries. E.g. the XML PSI doesn't have many nodes or navigators, so the index files have been combined into single files - `Navigators.md` and `TreeNodes.md`. Make sure to update the auto-index comment to reflect the starting letters of the entries in that file. + * Delete any empty files. If there are no utility classes, or element factories, delete the appropriate files (`Utils.md`, `ElementFactories.md`, etc.) +* Annotate the index files. Manually edit the index files and add brief comments for each class. Make sure to add the text after the end HTML comment `` +* Add the `Overview.md` and `Manipulation.md` files to provide article style docs to provide an overview of the AST and how to manipulate the tree. The other files are intended to be reference files. See existing files for examples. +* Add the files manually to `SUMMARY.md` + +## Updating a language + +When a new version of ReSharper is released, simply run PsiDocs2 and replace the existing content. Review the changes in a `git` tool. The changes are likely to be: + +* Changes to the type. Make sure the text content for that interface is still applicable. +* Removed types. Update the index file to remove the section for that type, and update any references in non-index files, e.g. `Overview.md` +* Added types. If the index files are auto-indexed (that is, the auto-index comment at the top of the file is still in place), the type will be added to the file, in the correct place alphabetically. If the index files are not auto-indexed (the auto-index comment has been removed), the type will be saved to a `-missing.md` file, where it can be manually copy-and-pasted to the appropriate file. Make sure to add a brief text section describing the type. + +## Editing tips + +* When manually creating a file such as `Overview.md`, types can be referenced simply by adding the HTML comments and running the PsiDocs2 app. This will update the file to contain the type definition. +* The index files can be split across any number of files. If the app does not create an optimal balance of files vs number of entries per file, then the files can be manually edited. As long as the auto-index comment exists, and reflects the letters of the entries in that file, the app will update the new index files appropriately. +* You can easily create index files ordered as you see fit by editing the auto-index comment to include the start and end index character for that file. For example, setting it to `