parser

package
v0.0.0-...-53d1009 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2017 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClangVersion

func ClangVersion() string

ClangVersion return the current clang version.

func CreateBulitinHeaders

func CreateBulitinHeaders() error

CreateBulitinHeaders creates(dumps) a clang builtin header to cache directory.

Types

type Config

type Config struct {
	Root        string
	JSONName    string
	PathRange   []string
	ClangOption uint32
	Jobs        int

	Debug bool
}

Config represents a parser config.

type Parser

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

Parser represents a C/C++ AST parser.

func NewParser

func NewParser(path string, config *Config) *Parser

NewParser return the new Parser.

func (*Parser) DeserializeTranslationUnit

func (p *Parser) DeserializeTranslationUnit(idx clang.Index, buf []byte) (clang.TranslationUnit, error)

DeserializeTranslationUnit deserialize the TranslationUnit from buf Clang serialized representation.

func (*Parser) Parse

func (p *Parser) Parse()

Parse parses the project directories.

func (*Parser) ParseFile

func (p *Parser) ParseFile(arg parseArg) error

ParseFile parses the C/C++ file.

func (*Parser) SerializeTranslationUnit

func (p *Parser) SerializeTranslationUnit(filename string, tu clang.TranslationUnit) []byte

SerializeTranslationUnit serialize the TranslationUnit to Clang serialized representation. TODO(zchee): Avoid ioutil.TempFile if possible.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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