clang

package
v0.0.0-...-7b96089 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const LanguageID psi.LanguageID = "c"

Variables

This section is empty.

Functions

func AstToPsi

func AstToPsi(sf *SourceFile, parsed antlr.ParserRuleContext) psi.Node

func NewLanguage

func NewLanguage(p project2.Project) psi.Language

Types

type BufferFileHandle

type BufferFileHandle struct {
	// contains filtered or unexported fields
}

func (BufferFileHandle) Close

func (b BufferFileHandle) Close() error

func (BufferFileHandle) Get

func (b BufferFileHandle) Get() (io.ReadCloser, error)

func (BufferFileHandle) Put

func (b BufferFileHandle) Put(src io.Reader) error

type Language

type Language struct {
	// contains filtered or unexported fields
}

func (*Language) CreateSourceFile

func (l *Language) CreateSourceFile(fileName string, fileHandle repofs.FileHandle) psi.SourceFile

func (*Language) Extensions

func (l *Language) Extensions() []string

func (*Language) Name

func (l *Language) Name() psi.LanguageID

func (*Language) Parse

func (l *Language) Parse(fileName string, code string) (psi.SourceFile, error)

func (*Language) ParseCodeBlock

func (l *Language) ParseCodeBlock(blockName string, block mdutils.CodeBlock) (psi.SourceFile, error)

type Node

type Node interface {
	psi.Node

	Initialize(self Node)

	Ast() antlr.ParserRuleContext
}

type NodeBase

type NodeBase[T antlr.ParserRuleContext] struct {
	psi.NodeBase
	// contains filtered or unexported fields
}

func NewNodeFor

func NewNodeFor(node antlr.ParserRuleContext) *NodeBase[antlr.ParserRuleContext]

func (*NodeBase[T]) Ast

func (nb *NodeBase[T]) Ast() antlr.ParserRuleContext

func (*NodeBase[T]) Comments

func (nb *NodeBase[T]) Comments() []string

func (*NodeBase[T]) Initialize

func (nb *NodeBase[T]) Initialize(self Node)

func (*NodeBase[T]) IsContainer

func (nb *NodeBase[T]) IsContainer() bool

func (*NodeBase[T]) IsLeaf

func (nb *NodeBase[T]) IsLeaf() bool

func (*NodeBase[T]) String

func (nb *NodeBase[T]) String() string

func (*NodeBase[T]) Update

func (nb *NodeBase[T]) Update(context.Context) error

type SourceFile

type SourceFile struct {
	psi.NodeBase
	// contains filtered or unexported fields
}

func NewSourceFile

func NewSourceFile(l *Language, name string, handle repofs.FileHandle) *SourceFile

func (*SourceFile) Error

func (sf *SourceFile) Error() error

func (*SourceFile) Language

func (sf *SourceFile) Language() psi.Language

func (*SourceFile) Load

func (sf *SourceFile) Load() error

func (*SourceFile) MergeCompletionResults

func (sf *SourceFile) MergeCompletionResults(ctx context.Context, scope psi.Scope, cursor psi.Cursor, newSource psi.SourceFile, newAst psi.Node) error

func (*SourceFile) Name

func (sf *SourceFile) Name() string

func (*SourceFile) OriginalText

func (sf *SourceFile) OriginalText() string

func (*SourceFile) Parse

func (sf *SourceFile) Parse(filename string, sourceCode string) (result psi.Node, err error)

func (*SourceFile) Path

func (sf *SourceFile) Path() string

func (*SourceFile) Replace

func (sf *SourceFile) Replace(code string) error

func (*SourceFile) Root

func (sf *SourceFile) Root() psi.Node

func (*SourceFile) SetRoot

func (sf *SourceFile) SetRoot(node antlr.ParserRuleContext, original string, tokens *antlr.CommonTokenStream) error

func (*SourceFile) ToCode

func (sf *SourceFile) ToCode(node psi.Node) (mdutils.CodeBlock, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL