-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Property place holder support inside SPEL
- Loading branch information
Showing
24 changed files
with
2,385 additions
and
825 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
headless-services/commons/jpql/grammars/PropertyPlaceHolder.g4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Broadcom, Inc. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Broadcom, Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
|
||
/** | ||
* Based on the answer to this Stack Overflow question: | ||
* https://stackoverflow.com/questions/6132529/antlr-parsing-java-properties | ||
*/ | ||
|
||
grammar PropertyPlaceHolder; | ||
|
||
start | ||
: line* EOF | ||
; | ||
|
||
line | ||
: Space* keyDefaultValuePair Space* EOF | ||
; | ||
|
||
keyDefaultValuePair | ||
: key | ||
| key defaultValue | ||
; | ||
|
||
defaultValue | ||
: Colon value | ||
; | ||
|
||
key | ||
: identifier (Dot identifier)* | ||
; | ||
|
||
identifier | ||
: Identifier+ | ||
; | ||
|
||
value | ||
: (Identifier | Exclamation | Number | Space | Backslash Backslash | Backslash LineBreak | Equals | Colon | Dot)* | ||
; | ||
|
||
Backslash : '\\'; | ||
Colon : ':'; | ||
Equals : '='; | ||
Exclamation: '!'; | ||
Number : '#'; | ||
Dot : '.'; | ||
|
||
LineBreak | ||
: '\r'? '\n' | ||
| '\r' | ||
; | ||
|
||
Space | ||
: ' ' | ||
| '\t' | ||
| '\f' | ||
| LineBreak | ||
; | ||
|
||
Identifier | ||
: IdentifierChar+ | ||
; | ||
|
||
fragment IdentifierChar | ||
: ~(' ' | ':' | '=' | '\r' | '\n' | '.') | ||
| Backslash (Colon | Equals) | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
...va/org/springframework/ide/vscode/parser/placeholder/PropertyPlaceHolderBaseListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
// Generated from PropertyPlaceHolder.g4 by ANTLR 4.13.1 | ||
package org.springframework.ide.vscode.parser.placeholder; | ||
|
||
import org.antlr.v4.runtime.ParserRuleContext; | ||
import org.antlr.v4.runtime.tree.ErrorNode; | ||
import org.antlr.v4.runtime.tree.TerminalNode; | ||
|
||
/** | ||
* This class provides an empty implementation of {@link PropertyPlaceHolderListener}, | ||
* which can be extended to create a listener which only needs to handle a subset | ||
* of the available methods. | ||
*/ | ||
@SuppressWarnings("CheckReturnValue") | ||
public class PropertyPlaceHolderBaseListener implements PropertyPlaceHolderListener { | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void enterStart(PropertyPlaceHolderParser.StartContext ctx) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void exitStart(PropertyPlaceHolderParser.StartContext ctx) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void enterLine(PropertyPlaceHolderParser.LineContext ctx) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void exitLine(PropertyPlaceHolderParser.LineContext ctx) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void enterKeyDefaultValuePair(PropertyPlaceHolderParser.KeyDefaultValuePairContext ctx) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void exitKeyDefaultValuePair(PropertyPlaceHolderParser.KeyDefaultValuePairContext ctx) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void enterDefaultValue(PropertyPlaceHolderParser.DefaultValueContext ctx) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void exitDefaultValue(PropertyPlaceHolderParser.DefaultValueContext ctx) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void enterKey(PropertyPlaceHolderParser.KeyContext ctx) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void exitKey(PropertyPlaceHolderParser.KeyContext ctx) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void enterIdentifier(PropertyPlaceHolderParser.IdentifierContext ctx) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void exitIdentifier(PropertyPlaceHolderParser.IdentifierContext ctx) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void enterValue(PropertyPlaceHolderParser.ValueContext ctx) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void exitValue(PropertyPlaceHolderParser.ValueContext ctx) { } | ||
|
||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void enterEveryRule(ParserRuleContext ctx) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void exitEveryRule(ParserRuleContext ctx) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void visitTerminal(TerminalNode node) { } | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* <p>The default implementation does nothing.</p> | ||
*/ | ||
@Override public void visitErrorNode(ErrorNode node) { } | ||
} |
Oops, something went wrong.