parser

package
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

The IDL parser reads IDL files for the Babel tools. IDL files describe models and web services. The parser package uses Go's built-in lexical analyzer and Go's YACC tool to parse IDL files. The result is placed into the structures defined in the idl package.

For more information, see the README.md file.

Index

Constants

View Source
const ABSTRACT = 57362
View Source
const AS = 57366
View Source
const BASETYPE = 57363
View Source
const BINARY = 57353
View Source
const BOOL = 57351
View Source
const CHAR = 57348
View Source
const COMMENT = 57352
View Source
const CONST = 57357
View Source
const ENUM = 57358
View Source
const EXTENDS = 57360
View Source
const FLOAT = 57350
View Source
const IDENT = 57346
View Source
const IMPORT = 57354
View Source
const INT = 57349
View Source
const LANG = 57356
View Source
const LIST = 57364
View Source
const MAP = 57365
View Source
const NAMESPACE = 57355
View Source
const SERVICE = 57361
View Source
const STRING = 57347
View Source
const STRUCT = 57359
View Source
const VOID = 57367

Variables

This section is empty.

Functions

func ParseIdl

func ParseIdl(fileName, lang string) (*idl.Idl, error)

ParseIdl parses the idl in the given file with tests for the given language. The Idl object is returned unless an error occured.

Types

type IdlLex

type IdlLex struct {
	Filename string
	Errors   []string
	// contains filtered or unexported fields
}

IdlLex is a lexer usable by yacc that uses Go's built-in lexer to provide lexical analysis for IDL files.

func (*IdlLex) Error

func (lex *IdlLex) Error(s string)

Error is called when a parsing error occcurs. Errors are collected in an array.

func (*IdlLex) Init

func (lex *IdlLex) Init(src io.Reader, fname string)

Init prepares the lexer for use.

func (*IdlLex) Lex

func (lex *IdlLex) Lex(yylval *yySymType) int

Lex returns the next token in the steam and classifies it.

Jump to

Keyboard shortcuts

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