;;; java-tags.wy -- Semantic LALR grammar for Java ;; Copyright (C) 2002-2014 Free Software Foundation, Inc. ;; ;; Author: David Ponce ;; Maintainer: David Ponce ;; Created: 26 Aug 2002 ;; Keywords: syntax ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . %package wisent-java-tags-wy %provide semantic/wisent/javat-wy %{ (declare-function semantic-parse-region "semantic" (start end &optional nonterminal depth returnonerror)) } %languagemode java-mode ;; The default start symbol %start compilation_unit ;; Alternate entry points ;; - Needed by partial re-parse %start package_declaration %start import_declaration %start class_declaration %start field_declaration %start method_declaration %start formal_parameter %start constructor_declaration %start interface_declaration ;; - Needed by EXPANDFULL clauses %start class_member_declaration %start interface_member_declaration %start formal_parameters ;; ----------------------------- ;; Block & Parenthesis terminals ;; ----------------------------- %type ;;syntax "\\s(\\|\\s)" matchdatatype block %token PAREN_BLOCK "(LPAREN RPAREN)" %token BRACE_BLOCK "(LBRACE RBRACE)" %token BRACK_BLOCK "(LBRACK RBRACK)" %token LPAREN "(" %token RPAREN ")" %token LBRACE "{" %token RBRACE "}" %token LBRACK "[" %token RBRACK "]" ;; ------------------ ;; Operator terminals ;; ------------------ %type ;;syntax "\\(\\s.\\|\\s$\\|\\s'\\)+" matchdatatype string %token NOT "!" %token NOTEQ "!=" %token MOD "%" %token MODEQ "%=" %token AND "&" %token ANDAND "&&" %token ANDEQ "&=" %token MULT "*" %token MULTEQ "*=" %token PLUS "+" %token PLUSPLUS "++" %token PLUSEQ "+=" %token COMMA "," %token MINUS "-" %token MINUSMINUS "--" %token MINUSEQ "-=" %token DOT "." %token DIV "/" %token DIVEQ "/=" %token COLON ":" %token SEMICOLON ";" %token LT "<" %token LSHIFT "<<" %token LSHIFTEQ "<<=" %token LTEQ "<=" %token EQ "=" %token EQEQ "==" %token GT ">" %token GTEQ ">=" %token RSHIFT ">>" %token RSHIFTEQ ">>=" %token URSHIFT ">>>" %token URSHIFTEQ ">>>=" %token QUESTION "?" %token XOR "^" %token XOREQ "^=" %token OR "|" %token OREQ "|=" %token OROR "||" %token COMP "~" ;; ----------------- ;; Literal terminals ;; ----------------- %type ;;syntax "\\(\\sw\\|\\s_\\)+" %token IDENTIFIER %type ;;syntax "\\s\"" matchdatatype sexp %token STRING_LITERAL %type ;;syntax semantic-lex-number-expression %token NUMBER_LITERAL %type syntax "\\\\u[0-9a-f][0-9a-f][0-9a-f][0-9a-f]" %token unicodecharacter ;; ----------------- ;; Keyword terminals ;; ----------------- ;; Generate a keyword analyzer %type ;;syntax "\\(\\sw\\|\\s_\\)+" matchdatatype keyword %keyword ABSTRACT "abstract" %put ABSTRACT summary "Class|Method declaration modifier: abstract {class|} ..." %keyword BOOLEAN "boolean" %put BOOLEAN summary "Primitive logical quantity type (true or false)" %keyword BREAK "break" %put BREAK summary "break [