C# 클래스 GraphView.GraphViewParser

The parser first extracts all tokens containing MATCH clauses, then replace them with multiline comment. The original parser will parse remaining tokens and return a syntax tree. Finally, MATCH clauses are inserted into appropriate QueryBlock by traversing the syntax tree.
파일 보기 프로젝트 열기: Microsoft/GraphView 1 사용 예제들

공개 메소드들

메소드 설명
GraphViewParser ( ) : System
Parse ( TextReader queryInput, IList &errors ) : WSqlFragment

Parses a GraphView query into a syntax tree. The parser re-uses the T-SQL parser by masking graph-extended query constructs with comments first and then putting them back into the syntax tree.

ParseAlterTableAddNodeTableColumnStatement ( string queryStr, List &nodeTableColumns, IList &errors ) : WSqlFragment

Parses a ALTER TABLE ADD PROPERTY/EDGE statement. The parser first replaces column annotations with white space, then uses T-SQL parser to parse it, and finally interprets the column annotations.

ParseAlterTableDropNodeTableColumnStatement ( string queryStr, IList &errors ) : WSqlFragment

Parses a ALTER TABLE DROP COLUMN statement.

ParseCreateNodeEdgeViewStatement ( string query, IList &errors ) : WSqlFragment
ParseCreateNodeTableStatement ( string queryStr, List &nodeTableColumns, IList &errors ) : WSqlFragment

Parses a CREATE TABLE statement. The parser first replaces column annotations with white space, then uses T-SQL parser to parse it, and finally interprets the column annotations.

비공개 메소드들

메소드 설명
ExtractMatchClause ( ) : void
FindReplaceGraphModificationStatements ( IList &errors ) : List

Finds all graph modification statements (INSERT NODE, INSERT EDGE, DELETE NODE, DELETE EDGE), records their positions in the script as a list of annotations, and replaces them by INSERT and DELETE, so that the token list can be parsed by the T-SQL parser.

ParseDataType ( IList tokens, int &nextToken, GraphView.WDataTypeReference &result, int &farestError ) : bool
ParseIdentifier ( IList tokens, int &nextToken, Identifier &result, int &farestError ) : bool
ParseIntegerLiteral ( IList tokens, int &nextToken, Literal &result, int &farestError ) : bool
ParseLiteralList ( IList tokens, int &nextToken, List &result, int &farestError ) : bool
ParseMatchClause ( IList tokens, int &nextToken, WMatchClause &result, int &farestError ) : bool
ParseMatchPath ( IList tokens, int &nextToken, WMatchPath &result, int &farestError ) : bool
ParseMatchPathEdge ( IList tokens, int &nextToken, WEdgeColumnReferenceExpression &result, int &farestError ) : bool
ParseMatchPathPart ( IList tokens, int &nextToken, WEdgeColumnReferenceExpression>.Tuple &result, int &farestError ) : bool
ParseMaxLiteral ( IList tokens, int &nextToken, Literal &result, int &farestError ) : bool
ParseMultiPartIdentifier ( IList tokens, int &nextToken, WMultiPartIdentifier &result, int &farestError ) : bool
ParseNestedObject ( List tokenList, int &nextToken, NestedObject &result, int &fareastError, bool supportMoreFieldType = false ) : bool
ParseNodeTableColumn ( IList tokens, int &nextToken, GraphView.WNodeTableColumn &result, int &farestError ) : bool
ParseParameterizedDataType ( IList tokens, int &nextToken, GraphView.WDataTypeReference &result, int &farestError ) : bool
ParseQuotedIdentifier ( IList tokens, int &nextToken, Identifier &result, int &farestError ) : bool
ParseSchemaObjectName ( IList tokens, int &nextToken, WSchemaObjectName &result, int &farestError ) : bool
ReadToken ( IList tokens, TSqlTokenType type, string &result, int &nextToken, int &farestError ) : bool
ReadToken ( IList tokens, string value, int &nextToken, int &farestError ) : bool
ReadToken ( List tokens, AnnotationTokenType type, int &nextToken, string &tokenValue, int &fareastError ) : bool
ReadToken ( List tokens, string text, int &nextToken, string &tokenValue, int &fareastError ) : bool

메소드 상세

GraphViewParser() 공개 메소드

public GraphViewParser ( ) : System
리턴 System

Parse() 공개 메소드

Parses a GraphView query into a syntax tree. The parser re-uses the T-SQL parser by masking graph-extended query constructs with comments first and then putting them back into the syntax tree.
public Parse ( TextReader queryInput, IList &errors ) : WSqlFragment
queryInput TextReader The query string
errors IList A list of parsing errors
리턴 WSqlFragment

ParseAlterTableAddNodeTableColumnStatement() 공개 메소드

Parses a ALTER TABLE ADD PROPERTY/EDGE statement. The parser first replaces column annotations with white space, then uses T-SQL parser to parse it, and finally interprets the column annotations.
public ParseAlterTableAddNodeTableColumnStatement ( string queryStr, List &nodeTableColumns, IList &errors ) : WSqlFragment
queryStr string The CREATE TABLE statement creating a ndoe table
nodeTableColumns List A list of columns of the node table
errors IList Parsing errors
리턴 WSqlFragment

ParseAlterTableDropNodeTableColumnStatement() 공개 메소드

Parses a ALTER TABLE DROP COLUMN statement.
public ParseAlterTableDropNodeTableColumnStatement ( string queryStr, IList &errors ) : WSqlFragment
queryStr string The CREATE TABLE statement creating a ndoe table
errors IList Parsing errors
리턴 WSqlFragment

ParseCreateNodeEdgeViewStatement() 공개 메소드

public ParseCreateNodeEdgeViewStatement ( string query, IList &errors ) : WSqlFragment
query string
errors IList
리턴 WSqlFragment

ParseCreateNodeTableStatement() 공개 메소드

Parses a CREATE TABLE statement. The parser first replaces column annotations with white space, then uses T-SQL parser to parse it, and finally interprets the column annotations.
public ParseCreateNodeTableStatement ( string queryStr, List &nodeTableColumns, IList &errors ) : WSqlFragment
queryStr string The CREATE TABLE statement creating a ndoe table
nodeTableColumns List A list of columns of the node table
errors IList Parsing errors
리턴 WSqlFragment