Class: CodeRay::Scanners::Java

Inherits:
Scanner
  • Object
show all
Defined in:
lib/coderay/scanners/java.rb

Overview

Scanner for Java.

Direct Known Subclasses

Groovy

Defined Under Namespace

Modules: BuiltinTypes

Constant Summary collapse

KEYWORDS =
%w[
  assert break case catch continue default do else
  finally for if instanceof import new package
  return switch throw try typeof while
  debugger export
]
RESERVED =

:nodoc:

%w[ const goto ]
CONSTANTS =

:nodoc:

%w[ false null true ]
MAGIC_VARIABLES =

:nodoc:

%w[ this super ]
TYPES =

:nodoc:

%w[
  boolean byte char class double enum float int interface long
  short void
] << '[]'
DIRECTIVES =

:nodoc: because int[] should be highlighted as a type

%w[
  abstract extends final implements native private protected public
  static strictfp synchronized throws transient volatile
]
IDENT_KIND =

:nodoc:

WordList.new(:ident).
add(KEYWORDS, :keyword).
add(RESERVED, :reserved).
add(CONSTANTS, :predefined_constant).
add(MAGIC_VARIABLES, :local_variable).
add(TYPES, :type).
add(BuiltinTypes::List, :predefined_type).
add(BuiltinTypes::List.select { |builtin| builtin[/(Error|Exception)$/] }, :exception).
add(DIRECTIVES, :directive)
ESCAPE =

:nodoc:

/ [bfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x
UNICODE_ESCAPE =

:nodoc:

/ u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x
STRING_CONTENT_PATTERN =
{
  "'" => /[^\\']+/,
  '"' => /[^\\"]+/,
  '/' => /[^\\\/]+/,
}
IDENT =

:nodoc:

/[a-zA-Z_][A-Za-z_0-9]*/

Constants inherited from Scanner

Scanner::DEFAULT_OPTIONS, Scanner::KINDS_NOT_LOC, Scanner::ScanError

Instance Attribute Summary

Attributes inherited from Scanner

#state

Attributes included from Plugin

#plugin_id

Method Summary

Methods inherited from Scanner

#binary_string, #column, #each, encoding, file_extension, #file_extension, #initialize, #lang, lang, #line, normalize, #reset, #string=, #tokenize, #tokens

Methods included from Plugin

#aliases, #plugin_host, #register_for, #title

Constructor Details

This class inherits a constructor from CodeRay::Scanners::Scanner