File: antlr-mode.el.html

The Emacs package ANTLR-Mode provides: syntax highlighting for ANTLR grammar files, automatic indentation, menus containing rule/token definitions and supported options and various other things like running ANTLR from within Emacs.

For details, check <https://antlr-mode.sourceforge.net/> or, if you prefer the manual style, follow all commands mentioned in the documentation of antlr-mode. ANTLR is a LL(k)-based recognition tool which generates lexers, parsers and tree transformers in Java, C++ or Sather and can be found at <https://www.antlr.org/>.

Bug fixes, bug reports, improvements, and suggestions for the newest version are strongly appreciated.

To-do/Wish-list:

 * Next Version [C-c C-w]. Produce HTML document with syntax highlighted
   and hyper-links (using htmlize).
 * Next Version [C-c C-u]. Insert/update special comments: each rule lists
   all rules which use the current rule. With font-lock update.
 * Next Version. Make hiding much more customizable.
 * Planned [C-c C-j]. Jump to generated coding.
 * Planned. Further support for imenu, i.e., include entries for method
   definitions at beginning of grammar class.
 * Planned [C-c C-p]. Pack/unpack rule/subrule & options (one/multi-line).

 * Probably. Show rules/dependencies for ANT like for Makefile (does ANT
   support vocabularies and grammar inheritance?), I have to look at
   jde-ant.el: https://jakarta.apache.org/ant/manual/OptionalTasks/antlr.html
 * Probably. Make indent-region faster, especially in actions. ELP
   profiling in a class init action shows half the time is spent in
   antlr-next-rule, the other half in c-guess-basic-syntax.
 * Unlikely. Sather as generated language with syntax highlighting etc/.
   Questions/problems: is sather-mode.el the standard mode for sather, is it
   still supported, what is its relationship to eiffel3.el? Requirement:
   this mode must not depend on a Sather mode.
 * Unlikely. Faster syntax highlighting: sectionize the buffer into Antlr
   and action code and run special highlighting functions on these regions.
   Problems: code size, this mode would depend on font-lock internals.

Defined variables (43)

antlr-action-syntax-tableSyntax table used for ANTLR action parsing.
antlr-action-visibilityVisibility of actions when command ‘antlr-hide-actions’ is used.
antlr-ask-about-saveIf not nil, M-x antlr-run-tool asks which buffers to save.
antlr-class-header-regexpRegexp matching class headers.
antlr-file-formats-alistLanguage dependent formats which specify generated files.
antlr-font-lock-additional-keywordsFont-lock keywords for ANTLR’s normal grammar code.
antlr-font-lock-defaultsFont-lock defaults used for ANTLR syntax highlighting.
antlr-font-lock-keywords-alistList of font-lock keywords for actions in the grammar.
antlr-font-lock-literal-regexpRegexp matching literals with special syntax highlighting, or nil.
antlr-font-lock-maximum-decorationThe maximum decoration level for fontifying actions.
antlr-help-rules-introIntroduction to use with M-x antlr-show-makefile-rules.
antlr-help-unknown-file-textString indicating the existence of unknown files in the Makefile.
antlr-imenu-nameNon-nil, if a "Index" menu should be added to the menubar.
antlr-indent-at-bol-alistAlist of regexps matching lines are indented at column 0.
antlr-indent-commentNon-nil, if the indentation should touch lines in block comments.
antlr-indent-item-regexpRegexp matching lines which should be indented by one TAB less.
antlr-indent-styleIf non-nil, cc-mode indentation style used for ‘antlr-mode’.
antlr-languageMajor mode corresponding to ANTLR’s "language" option.
antlr-language-alistList of ANTLR’s supported languages.
antlr-language-limit-n-regexpUsed to set a reasonable value for ‘antlr-language’.
antlr-makefile-specificationVariable to specify the appearance of the generated makefile rules.
antlr-mode-abbrev-tableAbbreviation table used in ‘antlr-mode’ buffers.
antlr-mode-hookHook called by ‘antlr-mode’.
antlr-mode-mapKeymap used in ‘antlr-mode’ buffers.
antlr-mode-menuMajor mode menu.
antlr-mode-syntax-tableSyntax table used in ‘antlr-mode’ buffers.
antlr-no-action-keywordsEmpty font-lock keywords for actions.
antlr-options-alistsDefinitions for Antlr’s options of all four different kinds.
antlr-options-assign-stringString containing ‘=’ to use between option name and value.
antlr-options-auto-colonNon-nil, if ‘:’ is inserted with a rule or subrule options section.
antlr-options-headingsHeadings for the four different option kinds.
antlr-options-push-markNon-nil, if inserting an option should set & push mark.
antlr-options-styleList of symbols which determine the style of option values.
antlr-options-use-submenusNon-nil, if the major mode menu should include option submenus.
antlr-slow-cache-diff-thresholdMaximum distance between ‘point’ and cache position for cache use.
antlr-slow-cache-enabling-symbolIf value is a bound symbol, cache will be used even with text changes.
antlr-slow-context-cacheInternal.
antlr-special-file-formatsLanguage independent formats which specify generated files.
antlr-tab-offset-alistAlist to determine whether to use ANTLR’s convention for TABs.
antlr-tool-commandCommand used in M-x antlr-run-tool to run the Antlr tool.
antlr-tool-versionThe version number of the Antlr tool.
antlr-unknown-file-formatsFormats which specify the names of unknown files.
antlr-versionANTLR major mode version number.

Defined functions (55)

antlr-beginning-of-body()
antlr-beginning-of-rule(&optional ARG)
antlr-c++-mode-extra(PHASE OPTION &rest DUMMIES)
antlr-c-init-language-vars()
antlr-directory-dependencies(DIRNAME)
antlr-downcase-literals(&optional TRANSFORM)
antlr-electric-character(&optional ARG)
antlr-end-of-body(&optional MSG)
antlr-end-of-rule(&optional ARG)
antlr-file-dependencies()
antlr-font-lock-keywords()
antlr-grammar-tokens()
antlr-hide-actions(ARG &optional SILENT)
antlr-imenu-create-index-function(&optional TOKENREFS-ONLY)
antlr-indent-command(&optional ARG)
antlr-indent-line()
antlr-insert-makefile-rules(&optional IN-MAKEFILE)
antlr-insert-option(LEVEL OPTION &optional LOCATION)
antlr-insert-option-area(LEVEL)
antlr-insert-option-do(LEVEL OPTION OLD AREA POS)
antlr-insert-option-existing(OLD VALUE)
antlr-insert-option-interactive(ARG)
antlr-insert-option-space(AREA OLD)
antlr-inside-rule-p()
antlr-invalidate-context-cache(&rest DUMMIES)
antlr-language-option(SEARCH)
antlr-language-option-extra(PHASE &rest DUMMIES)
antlr-makefile-insert-variable(NUMBER PRE POST)
antlr-mode()
antlr-mode-menu(ARG1)
antlr-next-rule(ARG SKIP-COMMENT)
antlr-option-kind(REQUESTED)
antlr-option-level(REQUESTED)
antlr-option-location(ORIG MIN-VIS MAX-VIS MIN-AREA MAX-AREA WITHP)
antlr-option-spec(LEVEL OPTION SPECS EXISTSP)
antlr-options-menu-filter(LEVEL MENU-ITEMS)
antlr-outside-rule-p()
antlr-re-search-forward(REGEXP BOUND)
antlr-read-boolean(INITIAL-CONTENTS PROMPT &optional TABLE)
antlr-read-value(INITIAL-CONTENTS PROMPT &optional AS-STRING TABLE TABLE-X)
antlr-run-tool(COMMAND FILE &optional SAVED)
antlr-run-tool-interactive()
antlr-search-backward(STRING)
antlr-search-forward(STRING)
antlr-set-tabs()
antlr-show-makefile-rules()
antlr-skip-exception-part(SKIP-COMMENT)
antlr-skip-file-prelude(SKIP-COMMENT)
antlr-skip-sexps(COUNT)
antlr-superclasses-glibs(SUPERS CLASSES)
antlr-syntactic-context()
antlr-syntactic-grammar-depth(POS BEG)
antlr-upcase-literals()
antlr-upcase-p(CHAR)
antlr-version-string(VERSION)

Defined faces (8)

antlr-defaultFace to prevent strings from language dependent highlighting. Do not change.
antlr-keywordANTLR keywords.
antlr-literalANTLR special literal tokens. It is used to highlight strings matched by the first regexp group of `antlr-font-lock-literal-regexp'.
antlr-ruledefANTLR rule references (definition).
antlr-rulerefANTLR rule references (usage).
antlr-syntaxANTLR syntax symbols like :, |, (, ), ....
antlr-tokendefANTLR token references (definition).
antlr-tokenrefANTLR token references (usage).