Previous: Grammar Tags, Up: Querying grammars


5.2.2 Querying Declarations

This section describes the high level API to query grammar declarations.

— Function: semantic-grammar-prologue

Return grammar prologue code as a string value.
See Prologue.

— Function: semantic-grammar-epilogue

Return grammar epilogue code as a string value.
See Epilogue.

— Function: semantic-grammar-package

Return the %package value as a string. If there is no %package statement in the grammar, return a default package name derived from the grammar file name.
See package Decl.

— Function: semantic-grammar-languagemode

Return the %languagemode value as a list of symbols or nil.
See languagemode Decl.

— Function: semantic-grammar-start

Return the %start value as a list of symbols or nil.
See start Decl.

— Function: semantic-grammar-scopestart

Return the %scopestart value as a symbol or nil.
See scopestart Decl.

— Function: semantic-grammar-quotemode

Return the %quotemode value as a symbol or nil.
See quotemode Decl.

— Function: semantic-grammar-keywords

Return the language keywords. That is an alist of (VALUE . TOKEN) where VALUE is the string value of the keyword and TOKEN is the terminal symbol identifying the keyword.
See keyword Decl.

— Function: semantic-grammar-keyword-properties keywords

Return the list of KEYWORDS properties.
See keyword Decl, See put Decl.

— Function: semantic-grammar-tokens

Return defined lexical tokens. That is an alist (TYPE . DEFS) where type is a %token <type> symbol and DEFS is an alist of (TOKEN . VALUE). TOKEN is the terminal symbol identifying the token and VALUE is the string value of the token or nil.
See token Decl.

— Function: semantic-grammar-token-properties tokens

Return properties of declared types. Types are explicitly declared by %type statements. Types found in TOKENS are those declared implicitly by %token statements. Properties can be set by %put and %type statements. Properties set by %type statements take precedence over those set by %put statements.
See token Decl, See type Decl, See put Decl.

— Function: semantic-grammar-use-macros

Return macro definitions from %use-macros statements. Also load the specified macro libraries.
See use-macros Decl.