Lines Matching defs:parser

10 package parser  package
23 type parser struct { struct
24 file *token.File
25 errors scanner.ErrorList
26 scanner scanner.Scanner
29 mode Mode // parsing mode
30 trace bool // == (mode & Trace != 0)
31 indent int // indentation used for tracing output
34 comments []*ast.CommentGroup
35 leadComment *ast.CommentGroup // last lead comment
36 lineComment *ast.CommentGroup // last line comment
39 pos token.Pos // token position
40 tok token.Token // one token look-ahead
41 lit string // token literal
47 syncPos token.Pos // last synchronization position
48 syncCnt int // number of calls to syncXXX without progress
51 exprLev int // < 0: in control clause, >= 0: in expression
54 pkgScope *ast.Scope // pkgScope.Outer == nil
55 topScope *ast.Scope // top-most scope; may be pkgScope
56 unresolved []*ast.Ident // unresolved identifiers
57 imports []*ast.ImportSpec // list of imports
61 labelScope *ast.Scope // label scope for current function
62 targetStack [][]*ast.Ident // stack of unresolved labels
65 func (p *parser) init(fset *token.FileSet, filename string, src []byte, mode Mode) {
83 func (p *parser) openScope() {
87 func (p *parser) closeScope() {
91 func (p *parser) openLabelScope() {
96 func (p *parser) closeLabelScope() {
111 …parser) declare(decl, data interface{}, scope *ast.Scope, kind ast.ObjKind, idents ...*ast.Ident) {
132 func (p *parser) shortVarDecl(decl *ast.AssignStmt, list []ast.Expr) {
170 func (p *parser) tryResolve(x ast.Expr, collectUnresolved bool) {
197 func (p *parser) resolve(x ast.Expr) {
204 func (p *parser) printTrace(a ...interface{}) {
219 func trace(p *parser, msg string) *parser {
226 func un(p *parser) {
232 func (p *parser) next0() {
253 func (p *parser) consumeComment() (comment *ast.Comment, endline int) {
277 func (p *parser) consumeCommentGroup(n int) (comments *ast.CommentGroup, endline int) {
308 func (p *parser) next() {
343 func (p *parser) error(pos token.Pos, msg string) {
347 func (p *parser) errorExpected(pos token.Pos, msg string) {
364 func (p *parser) expect(tok token.Token) token.Pos {
376 func (p *parser) expectClosing(tok token.Token, context string) token.Pos {
384 func (p *parser) expectSemi() {
396 func (p *parser) atComma(context string) bool {
417 func syncStmt(p *parser) {
455 func syncDecl(p *parser) {
479 func (p *parser) parseIdent() *ast.Ident {
491 func (p *parser) parseIdentList() (list []*ast.Ident) {
509 func (p *parser) parseExprList(lhs bool) (list []ast.Expr) {
523 func (p *parser) parseLhsList() []ast.Expr {
548 func (p *parser) parseRhsList() []ast.Expr {
555 func (p *parser) parseType() ast.Expr {
573 func (p *parser) parseTypeName() ast.Expr {
592 func (p *parser) parseArrayType() ast.Expr {
612 func (p *parser) makeIdentList(list []ast.Expr) []*ast.Ident {
628 func (p *parser) parseFieldDecl(scope *ast.Scope) *ast.Field {
669 func (p *parser) parseStructType() *ast.StructType {
696 func (p *parser) parsePointerType() *ast.StarExpr {
708 func (p *parser) tryVarType(isParam bool) ast.Expr {
725 func (p *parser) parseVarType(isParam bool) ast.Expr {
737 func (p *parser) parseVarList(isParam bool) (list []ast.Expr, typ ast.Expr) {
762 func (p *parser) parseParameterList(scope *ast.Scope, ellipsisOk bool) (params []*ast.Field) {
809 func (p *parser) parseParameters(scope *ast.Scope, ellipsisOk bool) *ast.FieldList {
824 func (p *parser) parseResult(scope *ast.Scope) *ast.FieldList {
843 func (p *parser) parseSignature(scope *ast.Scope) (params, results *ast.FieldList) {
854 func (p *parser) parseFuncType() (*ast.FuncType, *ast.Scope) {
866 func (p *parser) parseMethodSpec(scope *ast.Scope) *ast.Field {
894 func (p *parser) parseInterfaceType() *ast.InterfaceType {
918 func (p *parser) parseMapType() *ast.MapType {
932 func (p *parser) parseChanType() *ast.ChanType {
958 func (p *parser) tryIdentOrType() ast.Expr {
989 func (p *parser) tryType() ast.Expr {
1000 func (p *parser) parseStmtList() (list []ast.Stmt) {
1012 func (p *parser) parseBody(scope *ast.Scope) *ast.BlockStmt {
1028 func (p *parser) parseBlockStmt() *ast.BlockStmt {
1045 func (p *parser) parseFuncTypeOrLit() ast.Expr {
1067 func (p *parser) parseOperand(lhs bool) ast.Expr {
1112 func (p *parser) parseSelector(x ast.Expr) ast.Expr {
1122 func (p *parser) parseTypeAssertion(x ast.Expr) ast.Expr {
1140 func (p *parser) parseIndexOrSlice(x ast.Expr) ast.Expr {
1168 func (p *parser) parseCallOrConversion(fun ast.Expr) *ast.CallExpr {
1194 func (p *parser) parseElement(keyOk bool) ast.Expr {
1237 func (p *parser) parseElementList() (list []ast.Expr) {
1253 func (p *parser) parseLiteralValue(typ ast.Expr) ast.Expr {
1270 func (p *parser) checkExpr(x ast.Expr) ast.Expr {
1350 func (p *parser) checkExprOrType(x ast.Expr) ast.Expr {
1367 func (p *parser) parsePrimaryExpr(lhs bool) ast.Expr {
1421 func (p *parser) parseUnaryExpr(lhs bool) ast.Expr {
1491 func (p *parser) parseBinaryExpr(lhs bool, prec1 int) ast.Expr {
1517 func (p *parser) parseExpr(lhs bool) ast.Expr {
1525 func (p *parser) parseRhs() ast.Expr {
1529 func (p *parser) parseRhsOrType() ast.Expr {
1547 func (p *parser) parseSimpleStmt(mode int) (ast.Stmt, bool) {
1625 func (p *parser) parseCallExpr() *ast.CallExpr {
1637 func (p *parser) parseGoStmt() ast.Stmt {
1652 func (p *parser) parseDeferStmt() ast.Stmt {
1667 func (p *parser) parseReturnStmt() *ast.ReturnStmt {
1683 func (p *parser) parseBranchStmt(tok token.Token) *ast.BranchStmt {
1701 func (p *parser) makeExpr(s ast.Stmt) ast.Expr {
1712 func (p *parser) parseIfStmt() *ast.IfStmt {
1754 func (p *parser) parseTypeList() (list []ast.Expr) {
1768 func (p *parser) parseCaseClause(typeSwitch bool) *ast.CaseClause {
1811 func (p *parser) parseSwitchStmt() ast.Stmt {
1869 func (p *parser) parseCommClause() *ast.CommClause {
1927 func (p *parser) parseSelectStmt() *ast.SelectStmt {
1945 func (p *parser) parseForStmt() ast.Stmt {
2017 func (p *parser) parseStmt() (s ast.Stmt) {
2089 func (p *parser) parseImportSpec(doc *ast.CommentGroup, _ token.Token, _ int) ast.Spec {
2127 func (p *parser) parseValueSpec(doc *ast.CommentGroup, keyword token.Token, iota int) ast.Spec {
2161 func (p *parser) parseTypeSpec(doc *ast.CommentGroup, _ token.Token, _ int) ast.Spec {
2182 func (p *parser) parseGenDecl(keyword token.Token, f parseSpecFunction) *ast.GenDecl {
2213 func (p *parser) parseReceiver(scope *ast.Scope) *ast.FieldList {
2243 func (p *parser) parseFuncDecl() *ast.FuncDecl {
2293 func (p *parser) parseDecl(sync func(*parser)) ast.Decl {
2322 func (p *parser) parseFile() *ast.File {