Skip to content

Instantly share code, notes, and snippets.

@SocraticPhoenix
Created April 4, 2016 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SocraticPhoenix/b2ddc8da5f9f241153f9ecb92cabe27b to your computer and use it in GitHub Desktop.
Save SocraticPhoenix/b2ddc8da5f9f241153f9ecb92cabe27b to your computer and use it in GitHub Desktop.
package com.gmail.socraticphoenix.planet9;
import com.gmail.socraticphoenix.planet9.grammar.line.lines.SourceExtendsStatement;
import com.gmail.socraticphoenix.planet9.grammar.line.lines.SourceIsStatement;
import java.io.IOException;
public class Test {
public static void main(String[] args) throws IOException {
SourceIsStatement statement = new SourceIsStatement();
statement.tokenizer().tokenize("is class, abstract, public, generic<T is Object, T>").forEach(token -> System.out.println(token.write()));
System.out.println("---------");
SourceExtendsStatement extendsStatement = new SourceExtendsStatement();
extendsStatement.tokenizer().tokenize("extends planet9.Object, com.gmail.socraticphoenix.Base, List<Integer>").forEach(token -> System.out.println(token.write()));
}
/*
Output:
@type("class")
@property("abstract")
@visibility("public")
@generic(@generic(@generic("T"), @constraint("Object")), @generic(@generic("T")))
---------
@extends(@type(@type("planet9.Object")), @type(@type("com.gmail.socraticphoenix.Base")), @type(@type("List"), @generic(@type("Integer"))))
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment