Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<groupId>com.github.odiszapc</groupId>
<artifactId>nginxparser</artifactId>
<version>0.9.6</version>
<version>0.9.7-SNAPSHOT</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ T__10=11
T__11=12
T__12=13
T__13=14
Value=15
STR_EXT=16
Comment=17
Comment=15
Value=16
STR_EXT=17
REGEXP_PREFIXED=18
QUOTED_STRING=19
SINGLE_QUOTED=20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,18 @@ public class NginxBaseListener implements NginxListener {
* <p>The default implementation does nothing.</p>
*/
@Override public void exitRegexp(NginxParser.RegexpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterExp(NginxParser.ExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitExp(NginxParser.ExpContext ctx) { }
/**
* {@inheritDoc}
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ public class NginxBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitRegexp(NginxParser.RegexpContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitExp(NginxParser.ExpContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
Expand Down
81 changes: 41 additions & 40 deletions src/main/java/com/github/odiszapc/nginxparser/antlr/NginxLexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ public class NginxLexer extends Lexer {
new PredictionContextCache();
public static final int
T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9,
T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, Value=15, STR_EXT=16,
Comment=17, REGEXP_PREFIXED=18, QUOTED_STRING=19, SINGLE_QUOTED=20, WS=21;
T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, Comment=15, Value=16,
STR_EXT=17, REGEXP_PREFIXED=18, QUOTED_STRING=19, SINGLE_QUOTED=20, WS=21;
public static String[] modeNames = {
"DEFAULT_MODE"
};

public static final String[] ruleNames = {
"T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8",
"T__9", "T__10", "T__11", "T__12", "T__13", "Value", "STR_EXT", "Comment",
"T__9", "T__10", "T__11", "T__12", "T__13", "Comment", "Value", "STR_EXT",
"REGEXP_PREFIXED", "QUOTED_STRING", "RegexpPrefix", "StringCharacters",
"NON_ASCII", "EscapeSequence", "SINGLE_QUOTED", "WS"
};
Expand All @@ -39,7 +39,7 @@ public class NginxLexer extends Lexer {
};
private static final String[] _SYMBOLIC_NAMES = {
null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, "Value", "STR_EXT", "Comment", "REGEXP_PREFIXED", "QUOTED_STRING",
null, null, null, "Comment", "Value", "STR_EXT", "REGEXP_PREFIXED", "QUOTED_STRING",
"SINGLE_QUOTED", "WS"
};
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
Expand Down Expand Up @@ -105,23 +105,23 @@ public NginxLexer(CharStream input) {
"\b\3\b\3\b\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13"+
"\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r"+
"\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17"+
"\3\17\3\17\3\17\3\17\3\17\3\20\3\20\3\20\5\20z\n\20\3\21\3\21\6\21~\n"+
"\21\r\21\16\21\177\3\22\3\22\7\22\u0084\n\22\f\22\16\22\u0087\13\22\3"+
"\23\3\23\6\23\u008b\n\23\r\23\16\23\u008c\3\24\3\24\5\24\u0091\n\24\3"+
"\24\3\24\3\25\3\25\5\25\u0097\n\25\3\26\3\26\6\26\u009b\n\26\r\26\16\26"+
"\u009c\3\27\3\27\3\30\3\30\5\30\u00a3\n\30\3\31\3\31\7\31\u00a7\n\31\f"+
"\31\16\31\u00aa\13\31\3\31\3\31\3\32\6\32\u00af\n\32\r\32\16\32\u00b0"+
"\3\17\3\17\3\17\3\17\3\17\3\20\3\20\7\20y\n\20\f\20\16\20|\13\20\3\21"+
"\3\21\3\21\5\21\u0081\n\21\3\22\3\22\6\22\u0085\n\22\r\22\16\22\u0086"+
"\3\23\3\23\6\23\u008b\n\23\r\23\16\23\u008c\3\24\3\24\5\24\u0091\n\24"+
"\3\24\3\24\3\25\3\25\5\25\u0097\n\25\3\26\3\26\6\26\u009b\n\26\r\26\16"+
"\26\u009c\3\27\3\27\3\30\3\30\5\30\u00a3\n\30\3\31\3\31\7\31\u00a7\n\31"+
"\f\31\16\31\u00aa\13\31\3\31\3\31\3\32\6\32\u00af\n\32\r\32\16\32\u00b0"+
"\3\32\3\32\2\2\33\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31"+
"\16\33\17\35\20\37\21!\22#\23%\24\'\25)\2+\2-\2/\2\61\26\63\27\3\2\13"+
"\13\2##%&((,<??Aac|~~\u0080\u0080\4\2\f\f\17\17\13\2##%&((*<??Aac|~~\u0080"+
"\u0080\3\2\u0080\u0080\3\2,,\4\2$$^^\n\2$$))^^ddhhppttvv\4\2))^^\5\2\13"+
"\f\17\17\"\"\u00bc\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2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2\2\2%\u0088"+
"\3\2\2\2\'\u008e\3\2\2\2)\u0094\3\2\2\2+\u009a\3\2\2\2-\u009e\3\2\2\2"+
"/\u00a0\3\2\2\2\61\u00a4\3\2\2\2\63\u00ae\3\2\2\2\65\66\7=\2\2\66\4\3"+
"\2\2\2\678\7}\2\28\6\3\2\2\29:\7\177\2\2:\b\3\2\2\2;<\7k\2\2<=\7h\2\2"+
Expand All @@ -132,27 +132,28 @@ public NginxLexer(CharStream input) {
"c\2\2Z[\7u\2\2[\\\7v\2\2\\\30\3\2\2\2]^\7d\2\2^_\7t\2\2_`\7g\2\2`a\7c"+
"\2\2ab\7m\2\2b\32\3\2\2\2cd\7t\2\2de\7g\2\2ef\7f\2\2fg\7k\2\2gh\7t\2\2"+
"hi\7g\2\2ij\7e\2\2jk\7v\2\2k\34\3\2\2\2lm\7r\2\2mn\7g\2\2no\7t\2\2op\7"+
"o\2\2pq\7c\2\2qr\7p\2\2rs\7g\2\2st\7p\2\2tu\7v\2\2u\36\3\2\2\2vz\5!\21"+
"\2wz\5\'\24\2xz\5\61\31\2yv\3\2\2\2yw\3\2\2\2yx\3\2\2\2z \3\2\2\2{~\t"+
"\2\2\2|~\5-\27\2}{\3\2\2\2}|\3\2\2\2~\177\3\2\2\2\177}\3\2\2\2\177\u0080"+
"\3\2\2\2\u0080\"\3\2\2\2\u0081\u0085\7%\2\2\u0082\u0084\n\3\2\2\u0083"+
"\u0082\3\2\2\2\u0084\u0087\3\2\2\2\u0085\u0083\3\2\2\2\u0085\u0086\3\2"+
"\2\2\u0086$\3\2\2\2\u0087\u0085\3\2\2\2\u0088\u008a\5)\25\2\u0089\u008b"+
"\t\4\2\2\u008a\u0089\3\2\2\2\u008b\u008c\3\2\2\2\u008c\u008a\3\2\2\2\u008c"+
"\u008d\3\2\2\2\u008d&\3\2\2\2\u008e\u0090\7$\2\2\u008f\u0091\5+\26\2\u0090"+
"\u008f\3\2\2\2\u0090\u0091\3\2\2\2\u0091\u0092\3\2\2\2\u0092\u0093\7$"+
"\2\2\u0093(\3\2\2\2\u0094\u0096\t\5\2\2\u0095\u0097\t\6\2\2\u0096\u0095"+
"\3\2\2\2\u0096\u0097\3\2\2\2\u0097*\3\2\2\2\u0098\u009b\n\7\2\2\u0099"+
"\u009b\5/\30\2\u009a\u0098\3\2\2\2\u009a\u0099\3\2\2\2\u009b\u009c\3\2"+
"\2\2\u009c\u009a\3\2\2\2\u009c\u009d\3\2\2\2\u009d,\3\2\2\2\u009e\u009f"+
"\4\u0082\1\2\u009f.\3\2\2\2\u00a0\u00a2\7^\2\2\u00a1\u00a3\t\b\2\2\u00a2"+
"\u00a1\3\2\2\2\u00a2\u00a3\3\2\2\2\u00a3\60\3\2\2\2\u00a4\u00a8\7)\2\2"+
"\u00a5\u00a7\n\t\2\2\u00a6\u00a5\3\2\2\2\u00a7\u00aa\3\2\2\2\u00a8\u00a6"+
"\3\2\2\2\u00a8\u00a9\3\2\2\2\u00a9\u00ab\3\2\2\2\u00aa\u00a8\3\2\2\2\u00ab"+
"\u00ac\7)\2\2\u00ac\62\3\2\2\2\u00ad\u00af\t\n\2\2\u00ae\u00ad\3\2\2\2"+
"\u00af\u00b0\3\2\2\2\u00b0\u00ae\3\2\2\2\u00b0\u00b1\3\2\2\2\u00b1\u00b2"+
"\3\2\2\2\u00b2\u00b3\b\32\2\2\u00b3\64\3\2\2\2\17\2y}\177\u0085\u008c"+
"\u0090\u0096\u009a\u009c\u00a2\u00a8\u00b0\3\b\2\2";
"o\2\2pq\7c\2\2qr\7p\2\2rs\7g\2\2st\7p\2\2tu\7v\2\2u\36\3\2\2\2vz\7%\2"+
"\2wy\n\2\2\2xw\3\2\2\2y|\3\2\2\2zx\3\2\2\2z{\3\2\2\2{ \3\2\2\2|z\3\2\2"+
"\2}\u0081\5#\22\2~\u0081\5\'\24\2\177\u0081\5\61\31\2\u0080}\3\2\2\2\u0080"+
"~\3\2\2\2\u0080\177\3\2\2\2\u0081\"\3\2\2\2\u0082\u0085\t\3\2\2\u0083"+
"\u0085\5-\27\2\u0084\u0082\3\2\2\2\u0084\u0083\3\2\2\2\u0085\u0086\3\2"+
"\2\2\u0086\u0084\3\2\2\2\u0086\u0087\3\2\2\2\u0087$\3\2\2\2\u0088\u008a"+
"\5)\25\2\u0089\u008b\t\4\2\2\u008a\u0089\3\2\2\2\u008b\u008c\3\2\2\2\u008c"+
"\u008a\3\2\2\2\u008c\u008d\3\2\2\2\u008d&\3\2\2\2\u008e\u0090\7$\2\2\u008f"+
"\u0091\5+\26\2\u0090\u008f\3\2\2\2\u0090\u0091\3\2\2\2\u0091\u0092\3\2"+
"\2\2\u0092\u0093\7$\2\2\u0093(\3\2\2\2\u0094\u0096\t\5\2\2\u0095\u0097"+
"\t\6\2\2\u0096\u0095\3\2\2\2\u0096\u0097\3\2\2\2\u0097*\3\2\2\2\u0098"+
"\u009b\n\7\2\2\u0099\u009b\5/\30\2\u009a\u0098\3\2\2\2\u009a\u0099\3\2"+
"\2\2\u009b\u009c\3\2\2\2\u009c\u009a\3\2\2\2\u009c\u009d\3\2\2\2\u009d"+
",\3\2\2\2\u009e\u009f\4\u0082\1\2\u009f.\3\2\2\2\u00a0\u00a2\7^\2\2\u00a1"+
"\u00a3\t\b\2\2\u00a2\u00a1\3\2\2\2\u00a2\u00a3\3\2\2\2\u00a3\60\3\2\2"+
"\2\u00a4\u00a8\7)\2\2\u00a5\u00a7\n\t\2\2\u00a6\u00a5\3\2\2\2\u00a7\u00aa"+
"\3\2\2\2\u00a8\u00a6\3\2\2\2\u00a8\u00a9\3\2\2\2\u00a9\u00ab\3\2\2\2\u00aa"+
"\u00a8\3\2\2\2\u00ab\u00ac\7)\2\2\u00ac\62\3\2\2\2\u00ad\u00af\t\n\2\2"+
"\u00ae\u00ad\3\2\2\2\u00af\u00b0\3\2\2\2\u00b0\u00ae\3\2\2\2\u00b0\u00b1"+
"\3\2\2\2\u00b1\u00b2\3\2\2\2\u00b2\u00b3\b\32\2\2\u00b3\64\3\2\2\2\17"+
"\2z\u0080\u0084\u0086\u008c\u0090\u0096\u009a\u009c\u00a2\u00a8\u00b0"+
"\3\b\2\2";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ T__10=11
T__11=12
T__12=13
T__13=14
Value=15
STR_EXT=16
Comment=17
Comment=15
Value=16
STR_EXT=17
REGEXP_PREFIXED=18
QUOTED_STRING=19
SINGLE_QUOTED=20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ public interface NginxListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitRegexp(NginxParser.RegexpContext ctx);
/**
* Enter a parse tree produced by {@link NginxParser#exp}.
* @param ctx the parse tree
*/
void enterExp(NginxParser.ExpContext ctx);
/**
* Exit a parse tree produced by {@link NginxParser#exp}.
* @param ctx the parse tree
*/
void exitExp(NginxParser.ExpContext ctx);
/**
* Enter a parse tree produced by {@link NginxParser#locationBlockHeader}.
* @param ctx the parse tree
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package com.github.odiszapc.nginxparser.antlr;

import com.github.odiszapc.nginxparser.NgxConfig;
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.tree.ParseTree;
import org.antlr.v4.runtime.tree.TerminalNode;

import java.util.List;


public class NginxListenerImpl extends NginxBaseListener {
Expand All @@ -17,7 +12,7 @@ public NgxConfig getResult() {
}

@Override
public void enterConfig(@NotNull NginxParser.ConfigContext ctx) {
public void enterConfig(NginxParser.ConfigContext ctx) {
result = ctx.ret;
}
}
Loading