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
Build a Interpreter and Compiler for Arithmetic Expressions using ANTLR3 | |
Include operators +,-,* and / with usual mathematical precedence, brackets - “(“ and “)” | |
and constants that are all integers | |
- Build an ANTLR3 grammar for the expressions | |
- Generate AST | |
- Build an interpreter to evaluate expressions | |
- Add a rule to check for "division by zero" | |
- Build a compiler to Java bytecode (Bonus) |
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
<dependency> | |
<groupId>com.sourceclear.headlines</groupId> | |
<artifactId>complete</artifactId> | |
<version>0.1.6</version> | |
</dependency> |
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
<dependency> | |
<groupId>com.sourceclear.headlines</groupId> | |
<artifactId>complete</artifactId> | |
<version>0.1.4</version> | |
</dependency> |
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
/** | |
* the command has been executed, so extract extract the needed information | |
* from the application context. | |
*/ | |
public Object execute(ExecutionEvent event) throws ExecutionException { | |
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); | |
ISelectionService service = window.getSelectionService(); | |
IStructuredSelection structured = (IStructuredSelection) service.getSelection(); |
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
package interleavedexample; | |
import java.util.concurrent.Exchanger; | |
import java.util.logging.Logger; | |
/** | |
* | |
*/ | |
public class InterleavedRunnable implements Runnable { |
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
public interface ${name} { | |
////////////////////////////////// Methods \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ | |
} |
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
public class ${name} { | |
///////////////////////////// Class Attributes \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ | |
////////////////////////////// Class Methods \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ | |
//////////////////////////////// Attributes \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ | |
/////////////////////////////// Constructors \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ | |
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
package com.mycompany | |
import org.springframework.security.core.context.SecurityContextHolder | |
import org.springframework.security.* | |
import org.springframework.web.filter.GenericFilterBean; | |
import org.springframework.beans.factory.* | |
import org.springframework.context.* | |
import javax.servlet.* | |
import javax.servlet.http.* |
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
package com.mycompany | |
import org.springframework.security.* | |
import org.springframework.security.core.* | |
import org.springframework.security.authentication.* | |
import org.springframework.security.core.userdetails.UsernameNotFoundException; | |
class ApiTokenAuthenticationProvider implements AuthenticationProvider { | |
///////////////////////////// Class Attributes \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ |
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
package com.mycompany | |
import org.springframework.security.* | |
import org.springframework.security.core.* | |
class ApiTokenAuthentication implements Authentication { | |
///////////////////////////// Class Attributes \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ | |
////////////////////////////// Class Methods \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ |
NewerOlder