summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-01-24 17:07:56 +0100
committernea <nea@nea.moe>2023-01-24 17:07:56 +0100
commit2241c9f5d572bec5185eb5e7c2c4d937a479568d (patch)
tree77e1497b66bb6fc2aa9105777e2b02a4cf186d16
downloadbuildclient-2241c9f5d572bec5185eb5e7c2c4d937a479568d.tar.gz
buildclient-2241c9f5d572bec5185eb5e7c2c4d937a479568d.tar.bz2
buildclient-2241c9f5d572bec5185eb5e7c2c4d937a479568d.zip
Initial commit
-rw-r--r--.gitignore5
-rw-r--r--build.gradle10
-rw-r--r--gradle/wrapper/gradle-wrapper.jarbin0 -> 61574 bytes
-rw-r--r--gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xgradlew244
-rw-r--r--gradlew.bat92
-rw-r--r--settings.gradle.kts20
-rw-r--r--src/main/frege/buildclient/config/BuildConfig.fr88
-rw-r--r--src/main/frege/buildclient/config/BuildParser.fr117
-rw-r--r--src/main/frege/buildclient/config/BuildUniverse.fr8
-rw-r--r--src/main/frege/examples/HelloFrege.fr10
-rw-r--r--src/main/resources/testconfig.bcc17
12 files changed, 617 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b5e7dd6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+.frege
+lib
+.idea
+.gradle
+build
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..57b33f4
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,10 @@
+plugins {
+ id 'java'
+ id 'ch.fhnw.thga.frege' version '4e72b93'
+}
+
+
+frege {
+ version = '3.25.84'
+ release = '3.25alpha'
+}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..943f0cb
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..f398c33
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
+networkTimeout=10000
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..65dcd68
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,244 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
+done
+
+# This is normally unused
+# shellcheck disable=SC2034
+APP_BASE_NAME=${0##*/}
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+ echo "$*"
+} >&2
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD=$JAVA_HOME/jre/sh/java
+ else
+ JAVACMD=$JAVA_HOME/bin/java
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD=java
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC3045
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC3045
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
+ fi
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
+ done
+fi
+
+# Collect all arguments for the java command;
+# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
+# shell script including quotes and variable substitutions, so put them in
+# double quotes to make sure that they get re-expanded; and
+# * put everything else in single quotes, so that it's not re-expanded.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ org.gradle.wrapper.GradleWrapperMain \
+ "$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..93e3f59
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,92 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle.kts b/settings.gradle.kts
new file mode 100644
index 0000000..6cd218f
--- /dev/null
+++ b/settings.gradle.kts
@@ -0,0 +1,20 @@
+
+pluginManagement {
+ repositories {
+ mavenCentral()
+ gradlePluginPortal()
+ maven(url = "https://jitpack.io/") {
+ content {
+ includeGroupByRegex("(com|io)\\.github\\..+")
+ }
+ }
+ }
+ resolutionStrategy {
+ eachPlugin {
+ when (requested.id.id) {
+ "ch.fhnw.thga.frege" -> useModule("com.github.romangraef:frege-gradle-plugin:${requested.version}")
+ }
+ }
+ }
+}
+
diff --git a/src/main/frege/buildclient/config/BuildConfig.fr b/src/main/frege/buildclient/config/BuildConfig.fr
new file mode 100644
index 0000000..89be3a7
--- /dev/null
+++ b/src/main/frege/buildclient/config/BuildConfig.fr
@@ -0,0 +1,88 @@
+module buildclient.config.BuildConfig where
+import buildclient.config.BuildParser
+
+
+
+(<?>) :: Maybe b -> a -> Either a b
+(<?>) = flip maybeToEither
+
+(<#>) :: (c -> Maybe b) -> a -> (c -> Either a b)
+(<#>) f a b = f b <?> a
+
+maybeToEither :: a -> Maybe b -> Either a b
+maybeToEither _ (Just v) = Right v
+maybeToEither e _ = Left e
+
+extractSingleArg :: ASTDirective -> Maybe ASTValue
+extractSingleArg (ASTDirective _ [value] []) = Just value
+extractSingleArg _ = Nothing
+
+
+getArgDirective :: String -> [ASTDirective] -> Maybe ASTValue
+getArgDirective name directives = findDirective name directives >>= extractSingleArg
+
+getTypedArg :: String -> String -> [ASTDirective] -> (ASTValue -> Maybe a) -> Either String a
+getTypedArg name label directives mapper =
+ (findDirective name directives <?> ("Please add the missing " ++ label))
+ >>= (extractSingleArg <#> ("Please add an argument to the " ++ label))
+ >>= (mapper <#> ("Invalid argument type for " ++ label))
+
+getArg :: ASTDirective -> Int -> Maybe ASTValue
+getArg (ASTDirective _ args _) = getArg' args
+ where getArg' (a : _) 0 = Just a
+ getArg' (a : as) i = getArg' as (i - 1)
+ getArg' [] _ = Nothing
+
+toString :: ASTValue -> Maybe String
+toString (ASTValue.ASTString str) = Just str
+toString (ASTValue.ASTWord str) = Just str
+toString _ = Nothing
+
+expectString :: ASTValue -> Maybe String
+expectString (ASTValue.ASTString str) = Just str
+expectString _ = Nothing
+
+
+
+
+data BuildSource = GitSource {upstream :: String, branch :: Maybe String}
+derive Show BuildSource
+
+findSource :: ASTDirective -> Either String BuildSource
+findSource (ASTDirective _ [ASTWord "git"] block) = do
+ upstream <- getTypedArg "upstream" "git upstream directive" block expectString
+ return $ GitSource upstream (getArgDirective "branch" block >>= expectString)
+findSource (ASTDirective _ [ASTWord name] _) = Left ("Unknown source type " ++ name)
+findSource _ = Left "Please provide a source type"
+
+
+data BuildSystem = GradleBuild { task::String, project :: Maybe String }
+derive Show BuildSystem
+
+
+findBuildSystem :: ASTDirective -> Either String BuildSystem
+findBuildSystem (ASTDirective _ [ASTWord "gradle"] block) = do
+ task <- getTypedArg "task" "gradle task" block expectString
+ return $ GradleBuild task $ (getArgDirective "project" block >>= expectString)
+
+parseBuildConfig :: [ASTDirective] -> Either String BuildConfig
+parseBuildConfig directives = do
+ modid <- getTypedArg "modid" "modid" directives expectString
+ label <- getTypedArg "label" "label" directives expectString
+ description <- getTypedArg "description" "description" directives expectString
+ author <- getTypedArg "author" "author" directives expectString
+ source <- findDirective "source" directives <?> "Please provide a source block" >>= findSource
+ build <- findDirective "build" directives <?> "Please provide a build block" >>= findBuildSystem
+ return $ BuildConfig modid label description author (getArgDirective "webpresence" directives >>= expectString) source build
+
+data BuildConfig = BuildConfig
+ { modid :: String
+ , label :: String
+ , description :: String
+ , author :: String
+ , webpresence :: Maybe String
+ , source :: BuildSource
+ , build :: BuildSystem
+ }
+
+derive Show BuildConfig \ No newline at end of file
diff --git a/src/main/frege/buildclient/config/BuildParser.fr b/src/main/frege/buildclient/config/BuildParser.fr
new file mode 100644
index 0000000..f2cc763
--- /dev/null
+++ b/src/main/frege/buildclient/config/BuildParser.fr
@@ -0,0 +1,117 @@
+module buildclient.config.BuildParser where
+
+import Data.MicroParsec as MP
+
+-- <section>
+-- </section>
+data Token =
+ BareWord {bval::String}
+ | Number {nval::String}
+ | BraceOpen
+ | BraceClose
+ | NewLine
+ | QuotedString {sval::String}
+ | ERROR {position::Int, message:: String}
+derive Eq Token
+derive Show Token
+
+protected type Parser = MP.Parser [] Token
+
+protected isIdentifierStartChar :: Char -> Bool
+protected isIdentifierStartChar char = ('A' <= char && char <= 'Z') || ('a' <= char && char <= 'z') || char == '_'
+
+protected isDigit :: Char -> Bool
+protected isDigit char = ('0' <= char && char <= '9')
+
+protected isIdentifierChar :: Char -> Bool
+protected isIdentifierChar char = isIdentifierStartChar char || isDigit char
+
+lexer :: String -> [Token]
+lexer s = lex s 0
+
+private lex :: String -> Int -> [Token]
+private lex !cs !start
+ | endOfSeq = []
+ | ch == '\n' = Token.NewLine : lex cs (start + 1)
+ | ch.isWhitespace = lex cs (start + 1)
+ | ch == '"' = string 1 []
+ | ch == '{' = Token.BraceOpen : lex cs (start + 1)
+ | ch == '}' = Token.BraceClose : lex cs (start + 1)
+ | isDigit ch = takeWhile isDigit Token.Number 0 []
+ | isIdentifierStartChar ch = takeWhile isIdentifierChar Token.BareWord 0 []
+ | otherwise -> [Token.ERROR{position=start, message="Unexpected character"}]
+ where
+ endOfSeq = start >= cs.length
+ ch = at 0
+ at i = if start + i >= cs.length then '\0' else cs.charAt (start + i)
+ takeWhile charTest mapper off !acc
+ | charTest $ at off = takeWhile charTest mapper (off + 1) (at off : acc)
+ | otherwise = (mapper $ packed $ reverse acc) : lex cs (start + off)
+ string off !acc
+ | start + off >= cs.length = [Token.ERROR{position=start + off, message="Unterminated string literal"}]
+ | ch == '"' -> (Token.QuotedString $ packed (reverse acc)) : lex cs (start + off + 1)
+ | ch >= ' ' || ch == '\n' || ch == '\t' -> string (off + 1) (ch : acc)
+ | otherwise -> [Token.ERROR{position=start+off, message="Unknown string character"}]
+ where
+ ch = at off
+
+
+
+runParser :: Parser a -> [Token] -> (String | a)
+runParser p ts = case MP.runid p ts of
+ (Left msg, ts) → Left (MP.reporterror ts msg)
+ (right, _) → right
+
+
+
+protected parseNewLine :: Parser ()
+protected parseNewLine = const () <$> expect Token.NewLine <?> "newline expected"
+
+protected parseLBrace :: Parser ()
+protected parseLBrace = const () <$> expect Token.BraceOpen <?> "opening braces expected"
+
+protected parseRBrace :: Parser ()
+protected parseRBrace = const () <$> expect Token.BraceClose <?> "closing braces expected"
+
+protected parseEndOfStatement :: Parser ()
+protected parseEndOfStatement = (parseNewLine <|> parseRBrace <|> eos) <?> "expected end of statement"
+
+protected parseBareWord :: Parser String
+protected parseBareWord = (_.bval) <$> satisfy _.{bval?} <?> "bareword expected"
+
+protected parseQuotedString :: Parser String
+protected parseQuotedString = (_.sval) <$> satisfy _.{sval?} <?> "string expected"
+
+protected parseNumber :: Parser String
+protected parseNumber = (_.nval) <$> satisfy _.{nval?} <?> "number expected"
+
+data ASTValue = ASTString String | ASTWord String | ASTNumber Int
+data ASTDirective = ASTDirective {name::String, arguments:: [ASTValue], block:: [ASTDirective]}
+derive Show ASTValue
+derive Show ASTDirective
+
+protected parseValue :: Parser ASTValue
+protected parseValue = ASTString <$> parseQuotedString <|> ASTWord <$> parseBareWord <|> (ASTNumber . read) <$> parseNumber
+
+protected parseShortDirective :: Parser ASTDirective
+protected parseShortDirective = do
+ skip parseNewLine
+ name <- parseBareWord <?> "directive name expected"
+ args <- many parseValue
+ cond (parseEndOfStatement)
+ (return $ ASTDirective name args [])
+ do
+ parseLBrace
+ subdirectives <- many parseShortDirective
+ skip parseNewLine
+ parseRBrace
+ return $ ASTDirective name args subdirectives
+
+parseFile :: Parser [ASTDirective]
+parseFile = (many parseShortDirective) <* (skip parseNewLine) <* eos
+
+findDirective :: String -> [ASTDirective] -> Maybe ASTDirective
+findDirective name (directive:ds)
+ | directive.name == name = Just directive
+ | otherwise = findDirective name ds
+findDirective _ [] = Nothing
diff --git a/src/main/frege/buildclient/config/BuildUniverse.fr b/src/main/frege/buildclient/config/BuildUniverse.fr
new file mode 100644
index 0000000..6e7c8f4
--- /dev/null
+++ b/src/main/frege/buildclient/config/BuildUniverse.fr
@@ -0,0 +1,8 @@
+module buildclient.config.BuildUniverse where
+import buildclient.config.BuildConfig
+
+data BuildUniverse = BuildUniverse [BuildConfig]
+
+
+
+
diff --git a/src/main/frege/examples/HelloFrege.fr b/src/main/frege/examples/HelloFrege.fr
new file mode 100644
index 0000000..ff80635
--- /dev/null
+++ b/src/main/frege/examples/HelloFrege.fr
@@ -0,0 +1,10 @@
+module examples.HelloFrege where
+import Test.QuickCheck
+import buildclient.config.BuildParser (parseShortDirective, lexer, runParser, parseFile, findDirective)
+import buildclient.config.BuildConfig (findSource, findBuildSystem, parseBuildConfig)
+
+main = do
+ text <- readFile "src/main/resources/testconfig.bcc"
+ let lexed = lexer text
+ let (Right d) = runParser parseFile lexed
+ println $ show $ parseBuildConfig d
diff --git a/src/main/resources/testconfig.bcc b/src/main/resources/testconfig.bcc
new file mode 100644
index 0000000..d565639
--- /dev/null
+++ b/src/main/resources/testconfig.bcc
@@ -0,0 +1,17 @@
+modid "dankersskyblockmod"
+label "Dankers Skyblock Mod"
+description "Dankers Mod
+
+Multi Line test"
+author "Danker"
+webpresence "https://github.com/bowser0000/SkyblockMod"
+source git {
+ upstream "https://github.com/bowser0000/SkyblockMod.git"
+ branch "development"
+}
+
+build gradle {
+ task "jar"
+ project "forge-1.8.9"
+}
+