cookie

package
v0.0.0-...-4c43aeb Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Example
package main

import (
	"bramp.net/antlr4/cookie"

	"fmt"
	"github.com/antlr/antlr4/runtime/Go/antlr"
)

type exampleListener struct {
	*cookie.BasecookieListener
}

func (l *exampleListener) EnterEveryRule(ctx antlr.ParserRuleContext) {
	fmt.Println(ctx.GetText())
}
func main() {
	// Setup the input
	is := antlr.NewInputStream("...some text to parse...")

	// Create the Lexer
	lexer := cookie.NewcookieLexer(is)
	stream := antlr.NewCommonTokenStream(lexer, antlr.TokenDefaultChannel)

	// Create the Parser
	p := cookie.NewcookieParser(stream)
	p.BuildParseTrees = true
	p.AddErrorListener(antlr.NewDiagnosticErrorListener(true))

	// Finally walk the tree
	tree := p.Cookie()
	antlr.ParseTreeWalkerDefault.Walk(&exampleListener{}, tree)
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewcookieLexer

func NewcookieLexer(input antlr.CharStream) *cookieLexer

func NewcookieParser

func NewcookieParser(input antlr.TokenStream) *cookieParser

Types

type AttrContext

type AttrContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewAttrContext

func NewAttrContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AttrContext

func NewEmptyAttrContext

func NewEmptyAttrContext() *AttrContext

func (*AttrContext) EnterRule

func (s *AttrContext) EnterRule(listener antlr.ParseTreeListener)

func (*AttrContext) ExitRule

func (s *AttrContext) ExitRule(listener antlr.ParseTreeListener)

func (*AttrContext) GetParser

func (s *AttrContext) GetParser() antlr.Parser

func (*AttrContext) GetRuleContext

func (s *AttrContext) GetRuleContext() antlr.RuleContext

func (*AttrContext) IsAttrContext

func (*AttrContext) IsAttrContext()

func (*AttrContext) ToStringTree

func (s *AttrContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

func (*AttrContext) Token

func (s *AttrContext) Token() ITokenContext

type Av_pairContext

type Av_pairContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewAv_pairContext

func NewAv_pairContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Av_pairContext

func NewEmptyAv_pairContext

func NewEmptyAv_pairContext() *Av_pairContext

func (*Av_pairContext) Attr

func (s *Av_pairContext) Attr() IAttrContext

func (*Av_pairContext) EnterRule

func (s *Av_pairContext) EnterRule(listener antlr.ParseTreeListener)

func (*Av_pairContext) ExitRule

func (s *Av_pairContext) ExitRule(listener antlr.ParseTreeListener)

func (*Av_pairContext) GetParser

func (s *Av_pairContext) GetParser() antlr.Parser

func (*Av_pairContext) GetRuleContext

func (s *Av_pairContext) GetRuleContext() antlr.RuleContext

func (*Av_pairContext) IsAv_pairContext

func (*Av_pairContext) IsAv_pairContext()

func (*Av_pairContext) ToStringTree

func (s *Av_pairContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

func (*Av_pairContext) Value

func (s *Av_pairContext) Value() IValueContext

type Av_pairsContext

type Av_pairsContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewAv_pairsContext

func NewAv_pairsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Av_pairsContext

func NewEmptyAv_pairsContext

func NewEmptyAv_pairsContext() *Av_pairsContext

func (*Av_pairsContext) AllAv_pair

func (s *Av_pairsContext) AllAv_pair() []IAv_pairContext

func (*Av_pairsContext) Av_pair

func (s *Av_pairsContext) Av_pair(i int) IAv_pairContext

func (*Av_pairsContext) EnterRule

func (s *Av_pairsContext) EnterRule(listener antlr.ParseTreeListener)

func (*Av_pairsContext) ExitRule

func (s *Av_pairsContext) ExitRule(listener antlr.ParseTreeListener)

func (*Av_pairsContext) GetParser

func (s *Av_pairsContext) GetParser() antlr.Parser

func (*Av_pairsContext) GetRuleContext

func (s *Av_pairsContext) GetRuleContext() antlr.RuleContext

func (*Av_pairsContext) IsAv_pairsContext

func (*Av_pairsContext) IsAv_pairsContext()

func (*Av_pairsContext) ToStringTree

func (s *Av_pairsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type BasecookieListener

type BasecookieListener struct{}

BasecookieListener is a complete listener for a parse tree produced by cookieParser.

func (*BasecookieListener) EnterAttr

func (s *BasecookieListener) EnterAttr(ctx *AttrContext)

EnterAttr is called when production attr is entered.

func (*BasecookieListener) EnterAv_pair

func (s *BasecookieListener) EnterAv_pair(ctx *Av_pairContext)

EnterAv_pair is called when production av_pair is entered.

func (*BasecookieListener) EnterAv_pairs

func (s *BasecookieListener) EnterAv_pairs(ctx *Av_pairsContext)

EnterAv_pairs is called when production av_pairs is entered.

func (*BasecookieListener) EnterCookie

func (s *BasecookieListener) EnterCookie(ctx *CookieContext)

EnterCookie is called when production cookie is entered.

func (*BasecookieListener) EnterEveryRule

func (s *BasecookieListener) EnterEveryRule(ctx antlr.ParserRuleContext)

EnterEveryRule is called when any rule is entered.

func (*BasecookieListener) EnterName

func (s *BasecookieListener) EnterName(ctx *NameContext)

EnterName is called when production name is entered.

func (*BasecookieListener) EnterQuoted_string

func (s *BasecookieListener) EnterQuoted_string(ctx *Quoted_stringContext)

EnterQuoted_string is called when production quoted_string is entered.

func (*BasecookieListener) EnterToken

func (s *BasecookieListener) EnterToken(ctx *TokenContext)

EnterToken is called when production token is entered.

func (*BasecookieListener) EnterValue

func (s *BasecookieListener) EnterValue(ctx *ValueContext)

EnterValue is called when production value is entered.

func (*BasecookieListener) EnterWord

func (s *BasecookieListener) EnterWord(ctx *WordContext)

EnterWord is called when production word is entered.

func (*BasecookieListener) ExitAttr

func (s *BasecookieListener) ExitAttr(ctx *AttrContext)

ExitAttr is called when production attr is exited.

func (*BasecookieListener) ExitAv_pair

func (s *BasecookieListener) ExitAv_pair(ctx *Av_pairContext)

ExitAv_pair is called when production av_pair is exited.

func (*BasecookieListener) ExitAv_pairs

func (s *BasecookieListener) ExitAv_pairs(ctx *Av_pairsContext)

ExitAv_pairs is called when production av_pairs is exited.

func (*BasecookieListener) ExitCookie

func (s *BasecookieListener) ExitCookie(ctx *CookieContext)

ExitCookie is called when production cookie is exited.

func (*BasecookieListener) ExitEveryRule

func (s *BasecookieListener) ExitEveryRule(ctx antlr.ParserRuleContext)

ExitEveryRule is called when any rule is exited.

func (*BasecookieListener) ExitName

func (s *BasecookieListener) ExitName(ctx *NameContext)

ExitName is called when production name is exited.

func (*BasecookieListener) ExitQuoted_string

func (s *BasecookieListener) ExitQuoted_string(ctx *Quoted_stringContext)

ExitQuoted_string is called when production quoted_string is exited.

func (*BasecookieListener) ExitToken

func (s *BasecookieListener) ExitToken(ctx *TokenContext)

ExitToken is called when production token is exited.

func (*BasecookieListener) ExitValue

func (s *BasecookieListener) ExitValue(ctx *ValueContext)

ExitValue is called when production value is exited.

func (*BasecookieListener) ExitWord

func (s *BasecookieListener) ExitWord(ctx *WordContext)

ExitWord is called when production word is exited.

func (*BasecookieListener) VisitErrorNode

func (s *BasecookieListener) VisitErrorNode(node antlr.ErrorNode)

VisitErrorNode is called when an error node is visited.

func (*BasecookieListener) VisitTerminal

func (s *BasecookieListener) VisitTerminal(node antlr.TerminalNode)

VisitTerminal is called when a terminal node is visited.

type CookieContext

type CookieContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewCookieContext

func NewCookieContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CookieContext

func NewEmptyCookieContext

func NewEmptyCookieContext() *CookieContext

func (*CookieContext) AllAv_pairs

func (s *CookieContext) AllAv_pairs() []IAv_pairsContext

func (*CookieContext) Av_pairs

func (s *CookieContext) Av_pairs(i int) IAv_pairsContext

func (*CookieContext) EnterRule

func (s *CookieContext) EnterRule(listener antlr.ParseTreeListener)

func (*CookieContext) ExitRule

func (s *CookieContext) ExitRule(listener antlr.ParseTreeListener)

func (*CookieContext) GetParser

func (s *CookieContext) GetParser() antlr.Parser

func (*CookieContext) GetRuleContext

func (s *CookieContext) GetRuleContext() antlr.RuleContext

func (*CookieContext) IsCookieContext

func (*CookieContext) IsCookieContext()

func (*CookieContext) ToStringTree

func (s *CookieContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type IAttrContext

type IAttrContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsAttrContext differentiates from other interfaces.
	IsAttrContext()
}

IAttrContext is an interface to support dynamic dispatch.

type IAv_pairContext

type IAv_pairContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsAv_pairContext differentiates from other interfaces.
	IsAv_pairContext()
}

IAv_pairContext is an interface to support dynamic dispatch.

type IAv_pairsContext

type IAv_pairsContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsAv_pairsContext differentiates from other interfaces.
	IsAv_pairsContext()
}

IAv_pairsContext is an interface to support dynamic dispatch.

type ICookieContext

type ICookieContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsCookieContext differentiates from other interfaces.
	IsCookieContext()
}

ICookieContext is an interface to support dynamic dispatch.

type INameContext

type INameContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsNameContext differentiates from other interfaces.
	IsNameContext()
}

INameContext is an interface to support dynamic dispatch.

type IQuoted_stringContext

type IQuoted_stringContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsQuoted_stringContext differentiates from other interfaces.
	IsQuoted_stringContext()
}

IQuoted_stringContext is an interface to support dynamic dispatch.

type ITokenContext

type ITokenContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsTokenContext differentiates from other interfaces.
	IsTokenContext()
}

ITokenContext is an interface to support dynamic dispatch.

type IValueContext

type IValueContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsValueContext differentiates from other interfaces.
	IsValueContext()
}

IValueContext is an interface to support dynamic dispatch.

type IWordContext

type IWordContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsWordContext differentiates from other interfaces.
	IsWordContext()
}

IWordContext is an interface to support dynamic dispatch.

type NameContext

type NameContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyNameContext

func NewEmptyNameContext() *NameContext

func NewNameContext

func NewNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NameContext

func (*NameContext) Attr

func (s *NameContext) Attr() IAttrContext

func (*NameContext) EnterRule

func (s *NameContext) EnterRule(listener antlr.ParseTreeListener)

func (*NameContext) ExitRule

func (s *NameContext) ExitRule(listener antlr.ParseTreeListener)

func (*NameContext) GetParser

func (s *NameContext) GetParser() antlr.Parser

func (*NameContext) GetRuleContext

func (s *NameContext) GetRuleContext() antlr.RuleContext

func (*NameContext) IsNameContext

func (*NameContext) IsNameContext()

func (*NameContext) ToStringTree

func (s *NameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type Quoted_stringContext

type Quoted_stringContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyQuoted_stringContext

func NewEmptyQuoted_stringContext() *Quoted_stringContext

func NewQuoted_stringContext

func NewQuoted_stringContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Quoted_stringContext

func (*Quoted_stringContext) EnterRule

func (s *Quoted_stringContext) EnterRule(listener antlr.ParseTreeListener)

func (*Quoted_stringContext) ExitRule

func (s *Quoted_stringContext) ExitRule(listener antlr.ParseTreeListener)

func (*Quoted_stringContext) GetParser

func (s *Quoted_stringContext) GetParser() antlr.Parser

func (*Quoted_stringContext) GetRuleContext

func (s *Quoted_stringContext) GetRuleContext() antlr.RuleContext

func (*Quoted_stringContext) IsQuoted_stringContext

func (*Quoted_stringContext) IsQuoted_stringContext()

func (*Quoted_stringContext) STRING

func (*Quoted_stringContext) ToStringTree

func (s *Quoted_stringContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type TokenContext

type TokenContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyTokenContext

func NewEmptyTokenContext() *TokenContext

func NewTokenContext

func NewTokenContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TokenContext

func (*TokenContext) EnterRule

func (s *TokenContext) EnterRule(listener antlr.ParseTreeListener)

func (*TokenContext) ExitRule

func (s *TokenContext) ExitRule(listener antlr.ParseTreeListener)

func (*TokenContext) GetParser

func (s *TokenContext) GetParser() antlr.Parser

func (*TokenContext) GetRuleContext

func (s *TokenContext) GetRuleContext() antlr.RuleContext

func (*TokenContext) IsTokenContext

func (*TokenContext) IsTokenContext()

func (*TokenContext) TOKEN

func (s *TokenContext) TOKEN() antlr.TerminalNode

func (*TokenContext) ToStringTree

func (s *TokenContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type ValueContext

type ValueContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyValueContext

func NewEmptyValueContext() *ValueContext

func NewValueContext

func NewValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ValueContext

func (*ValueContext) EnterRule

func (s *ValueContext) EnterRule(listener antlr.ParseTreeListener)

func (*ValueContext) ExitRule

func (s *ValueContext) ExitRule(listener antlr.ParseTreeListener)

func (*ValueContext) GetParser

func (s *ValueContext) GetParser() antlr.Parser

func (*ValueContext) GetRuleContext

func (s *ValueContext) GetRuleContext() antlr.RuleContext

func (*ValueContext) IsValueContext

func (*ValueContext) IsValueContext()

func (*ValueContext) ToStringTree

func (s *ValueContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

func (*ValueContext) Word

func (s *ValueContext) Word() IWordContext

type WordContext

type WordContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyWordContext

func NewEmptyWordContext() *WordContext

func NewWordContext

func NewWordContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WordContext

func (*WordContext) EnterRule

func (s *WordContext) EnterRule(listener antlr.ParseTreeListener)

func (*WordContext) ExitRule

func (s *WordContext) ExitRule(listener antlr.ParseTreeListener)

func (*WordContext) GetParser

func (s *WordContext) GetParser() antlr.Parser

func (*WordContext) GetRuleContext

func (s *WordContext) GetRuleContext() antlr.RuleContext

func (*WordContext) IsWordContext

func (*WordContext) IsWordContext()

func (*WordContext) Quoted_string

func (s *WordContext) Quoted_string() IQuoted_stringContext

func (*WordContext) ToStringTree

func (s *WordContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

func (*WordContext) Token

func (s *WordContext) Token() ITokenContext

Jump to

Keyboard shortcuts

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