Skip to content

Commit

Permalink
project update
Browse files Browse the repository at this point in the history
  • Loading branch information
szabototo89 committed May 7, 2014
1 parent 9a8a4d9 commit 2279efe
Show file tree
Hide file tree
Showing 83 changed files with 1,417 additions and 1,082 deletions.
Binary file modified docs/Diplomamunka_Szabo_Tamas.docx
Binary file not shown.
38 changes: 6 additions & 32 deletions grammar-selector/Selector.g4
Original file line number Diff line number Diff line change
@@ -1,52 +1,26 @@
grammar Selector;


init : selectors
init : '[' selectors ']'
;

selectors : selector (',' selector)*
;

selector : statement
| selector operator selector <assoc=right>
;
| statement operator selector
;

attribute : '[' ID '=' ID ']'
attribute : '[' Property=ID '=' Value=ID ']'
;

operator : '>'
| '+'
;

statement : baseStatement attribute*
;

baseStatement : Statement=WHILE
| Statement=FOREACH
| Statement=FUNCTION
| Statement=IF
| Statement=TRUE_STATEMENT
| Statement=ELSE_STATEMENT
| Statement=BODY
| Statement=EXPRESSION
| Statement=VARIABLE
| Statement=ALL
statement : Selector=ID Attributes=attribute*
;


WHILE : 'while';
FOREACH : 'foreach';
FUNCTION : 'function';
IF : 'if';
TRUE_STATEMENT : 'else-if';
ELSE_STATEMENT : 'else';
BODY : 'body';
EXPRESSION : 'expression';
VARIABLE : 'variable';
DECLARATION : 'declaration';
ALL : '*';

ID : '@'? (LETTER|'_') (LETTER|'_'|'-'|[0-9])*;
ID : ('@'? (LETTER|'_') (LETTER|'_'|'-'|[0-9])*) | '*';

fragment
LETTER : [a-zA-Z];
Expand Down
2 changes: 1 addition & 1 deletion grammar-selector/example.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
if[condition=true][attribute=not-null] > body > if > body + while
[if > sequence > sequence]
46 changes: 11 additions & 35 deletions grammar-selector/src/Selector.tokens
Original file line number Diff line number Diff line change
@@ -1,37 +1,13 @@
FUNCTION=9
NEWLINE=20
VARIABLE=15
WHILE=7
T__1=5
ALL=17
T__0=6
T__3=3
T__2=4
WHITESPACE=19
TRUE_STATEMENT=11
FOREACH=8
ELSE_STATEMENT=12
BODY=13
ID=18
DECLARATION=16
EXPRESSION=14
T__5=1
IF=10
T__4=2
'foreach'=8
'else-if'=11
'else'=12
'>'=2
'expression'=14
'='=6
'if'=10
'*'=17
'['=5
'while'=7
'body'=13
'+'=4
WHITESPACE=7
NEWLINE=8
ID=6
T__1=4
T__0=5
T__3=2
T__2=3
T__4=1
'='=5
'['=4
','=3
'function'=9
'variable'=15
'declaration'=16
'>'=2
']'=1
Binary file modified grammar-selector/src/SelectorBaseListener.class
Binary file not shown.
79 changes: 33 additions & 46 deletions grammar-selector/src/SelectorBaseListener.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from ../Selector.g4 by ANTLR 4.2
// Generated from ../Selector.g4 by ANTLR 4.1

import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.misc.NotNull;
Expand All @@ -13,117 +13,104 @@
public class SelectorBaseListener implements SelectorListener {
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void enterStatement(@NotNull SelectorParser.StatementContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void exitStatement(@NotNull SelectorParser.StatementContext ctx) { }

/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void enterSelector(@NotNull SelectorParser.SelectorContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void exitSelector(@NotNull SelectorParser.SelectorContext ctx) { }

/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void enterSelectors(@NotNull SelectorParser.SelectorsContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void exitSelectors(@NotNull SelectorParser.SelectorsContext ctx) { }

/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterBaseStatement(@NotNull SelectorParser.BaseStatementContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitBaseStatement(@NotNull SelectorParser.BaseStatementContext ctx) { }

/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void enterAttribute(@NotNull SelectorParser.AttributeContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void exitAttribute(@NotNull SelectorParser.AttributeContext ctx) { }

/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void enterInit(@NotNull SelectorParser.InitContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void exitInit(@NotNull SelectorParser.InitContext ctx) { }

/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void enterOperator(@NotNull SelectorParser.OperatorContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void exitOperator(@NotNull SelectorParser.OperatorContext ctx) { }

/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void enterEveryRule(@NotNull ParserRuleContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void exitEveryRule(@NotNull ParserRuleContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void visitTerminal(@NotNull TerminalNode node) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
* <p/>
* The default implementation does nothing.
*/
@Override public void visitErrorNode(@NotNull ErrorNode node) { }
}
Binary file modified grammar-selector/src/SelectorBaseVisitor.class
Binary file not shown.
46 changes: 19 additions & 27 deletions grammar-selector/src/SelectorBaseVisitor.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from ../Selector.g4 by ANTLR 4.2
// Generated from ../Selector.g4 by ANTLR 4.1
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;

Expand All @@ -13,57 +13,49 @@
public class SelectorBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements SelectorVisitor<T> {
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitStatement(@NotNull SelectorParser.StatementContext ctx) { return visitChildren(ctx); }

/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitSelector(@NotNull SelectorParser.SelectorContext ctx) { return visitChildren(ctx); }

/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitSelectors(@NotNull SelectorParser.SelectorsContext ctx) { return visitChildren(ctx); }

/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitBaseStatement(@NotNull SelectorParser.BaseStatementContext ctx) { return visitChildren(ctx); }

/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitAttribute(@NotNull SelectorParser.AttributeContext ctx) { return visitChildren(ctx); }

/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitInit(@NotNull SelectorParser.InitContext ctx) { return visitChildren(ctx); }

/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitOperator(@NotNull SelectorParser.OperatorContext ctx) { return visitChildren(ctx); }
}
Binary file modified grammar-selector/src/SelectorLexer.class
Binary file not shown.
Loading

0 comments on commit 2279efe

Please sign in to comment.