Giter VIP home page Giter VIP logo

eliteavocado / iflog-lang Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 3.97 MB

A declarative programming language for Textadventure-Games (also known as Interactive Fiction), inspired by the deductive language Datalog, which in itself is a syntactic subset of Prolog.

License: Apache License 2.0

Java 99.31% ANTLR 0.69%
datalog declarative-language declarative-programming game-development gamebasedlearning interactive-fiction programming-language prolog sql textadventure textadventure-game

iflog-lang's People

Contributors

eliteavocado avatar

Watchers

 avatar

iflog-lang's Issues

empty select and empty loop after translation

This happens if vars are derived but none of them are ever used in the rule.
The result is basically an empty select or an unknown loop var.
In practice this should rarely happen but it should be caught nonetheless and a warning should be thrown.
Also the select and empty loop should never be translated.

Sample IFLog Code that produces that error:

def A(x: int, y: int) {}
def B(y: int) {}

C() {
	r0: print(c) :- A(a, c) | B(b), b > 3;
	r1: noaction :- A(a, _), multi(a);
}

Resulting PostgreSQL Code:

CREATE TABLE A(
x INTEGER NOT NULL,
y INTEGER NOT NULL
);

CREATE TABLE B(
y INTEGER NOT NULL
);

CREATE FUNCTION C() RETURNS VOID
LANGUAGE PLPGSQL
SECURITY DEFINER
AS
$BODY$
#variable_conflict error
-- #variable_conflict use_variable
-- #variable_conflict use_column
DECLARE
lvar0_c INTEGER;
lvar0_print_0 INTEGER;
BEGIN

SELECT t0.y INTO STRICT lvar0_c
FROM A t0;
SELECT  INTO STRICT 
FROM B t0
WHERE t0.y > 3;
lvar0_print_0 := lvar0_c;
RAISE NOTICE '%', lvar0_print_0;

FOR lvar1_a IN SELECT t0.x
FROM A t0
LOOP

END LOOP;

END
$BODY$;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.