Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rrevenantt committed Feb 10, 2020
1 parent ca4149e commit 123c306
Show file tree
Hide file tree
Showing 5 changed files with 507 additions and 508 deletions.
92 changes: 46 additions & 46 deletions tests/gen/csvlexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ pub const WS: isize = 4;
pub const TEXT: isize = 5;
pub const STRING: isize = 6;
pub const channelNames: [&'static str; 0 + 2] = [
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
];

pub const modeNames: [&'static str; 1] = [
"DEFAULT_MODE"
"DEFAULT_MODE"
];

pub const ruleNames: [&'static str; 6] = [
"T__0", "T__1", "T__2", "WS", "TEXT", "STRING"
"T__0", "T__1", "T__2", "WS", "TEXT", "STRING"
];


pub const _LITERAL_NAMES: [Option<&'static str>; 4] = [
None, Some("','"), Some("'\r'"), Some("'\n'")
None, Some("','"), Some("'\r'"), Some("'\n'")
];
pub const _SYMBOLIC_NAMES: [Option<&'static str>; 7] = [
None, None, None, None, Some("WS"), Some("TEXT"), Some("STRING")
None, None, None, None, Some("WS"), Some("TEXT"), Some("STRING")
];
lazy_static! {
static ref _shared_context_cache: Arc<PredictionContextCache> = Arc::new(PredictionContextCache::new());
Expand All @@ -56,22 +56,22 @@ lazy_static! {


pub struct CSVLexer {
base: BaseLexer<CSVLexerActions>,
base: BaseLexer<CSVLexerActions>,
// static { RuntimeMetaData.checkVersion("4.7.2", RuntimeMetaData.VERSION); }
}

impl Deref for CSVLexer {
type Target = BaseLexer<CSVLexerActions>;
type Target = BaseLexer<CSVLexerActions>;

fn deref(&self) -> &Self::Target {
&self.base
}
fn deref(&self) -> &Self::Target {
&self.base
}
}

impl DerefMut for CSVLexer {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.base
}
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.base
}
}


Expand All @@ -89,29 +89,29 @@ impl CSVLexer {

fn add_error_listener(&mut self, _listener: Box<ErrorListener>) {
self.base.add_error_listener(_listener);
}
}

fn remove_error_listeners(&mut self) {
self.base.remove_error_listeners()
}
fn remove_error_listeners(&mut self) {
self.base.remove_error_listeners()
}

fn get_grammar_file_name(&self) -> &'static str {
"CSVLexer.g4"
}
fn get_grammar_file_name(&self) -> &'static str {
"CSVLexer.g4"
}

pub fn new(input: Box<dyn CharStream>) -> Self {
Self {
base: BaseLexer::new_base_lexer(
input,
LexerATNSimulator::new_lexer_atnsimulator(
_ATN.clone(),
_decision_to_DFA.clone(),
_shared_context_cache.clone(),
),
Box::new(CSVLexerActions {}),
)
}
}
pub fn new(input: Box<dyn CharStream>) -> Self {
Self {
base: BaseLexer::new_base_lexer(
input,
LexerATNSimulator::new_lexer_atnsimulator(
_ATN.clone(),
_decision_to_DFA.clone(),
_shared_context_cache.clone(),
),
Box::new(CSVLexerActions {}),
)
}
}
}

pub struct CSVLexerActions {}
Expand All @@ -123,31 +123,31 @@ impl LexerRecog for CSVLexerActions {}
impl Recognizer for CSVLexerActions {}

impl Actions for CSVLexerActions {
type Recog = BaseLexer<CSVLexerActions>;
type Recog = BaseLexer<CSVLexerActions>;
}

impl CSVLexerActions {}

impl TokenSource for CSVLexer {
fn next_token(&mut self) -> Box<dyn Token> {
self.base.next_token()
}
fn next_token(&mut self) -> Box<dyn Token> {
self.base.next_token()
}

fn get_line(&self) -> isize {
self.base.get_line()
}
fn get_line(&self) -> isize {
self.base.get_line()
}

fn get_char_position_in_line(&self) -> isize {
self.base.get_char_position_in_line()
}

fn get_input_stream(&mut self) -> &mut dyn CharStream {
self.base.get_input_stream()
}
self.base.get_input_stream()
}

fn get_token_factory(&self) -> &dyn TokenFactory {
self.base.get_token_factory()
}
fn get_token_factory(&self) -> &dyn TokenFactory {
self.base.get_token_factory()
}
}


Expand All @@ -172,7 +172,7 @@ lazy_static! {


const _serializedATN: &'static str =
"\x03\u{608b}\u{a72a}\u{8133}\u{b9ed}\u{417c}\u{3be7}\u{7786}\u{5964}\x02\
"\x03\u{608b}\u{a72a}\u{8133}\u{b9ed}\u{417c}\u{3be7}\u{7786}\u{5964}\x02\
\x08\x2c\x08\x01\x04\x02\x09\x02\x04\x03\x09\x03\x04\x04\x09\x04\x04\x05\
\x09\x05\x04\x06\x09\x06\x04\x07\x09\x07\x03\x02\x03\x02\x03\x03\x03\x03\
\x03\x04\x03\x04\x03\x05\x06\x05\x17\x0a\x05\x0d\x05\x0e\x05\x18\x03\x05\
Expand Down
Loading

0 comments on commit 123c306

Please sign in to comment.