Code Monkey home page Code Monkey logo

ccal-compiler's Introduction

ccal-compiler

1. Overview

The language is not case sensitive. A nonterminal, X, is represented by enclosing it in angle brackets, e.g. hXi. A terminal is represented without angle brackets. A bold typeface is used to represent terminal symbols in the language and reserved words, whereas a non-bold typeface is used for symbols that are used to group terminals and nonterminals together. Source code is kept in files with the .ccl extension, e.g. hello world.ccl.

2. Syntax

The reserved words in the language are var, const, return, integer, boolean, void, main, if, else, while and skip. The following are tokens in the language: , ; : = { } ( ) + - ∼ || && == != < <= > >=. Integers are represented by a string of one or more digits (‘0’-‘9’) that do not start with the digit ‘0’, but may start with a minus sign (‘-’), e.g. 123, -456. Identifiers are represented by a string of letters, digits or underscore character (‘ ’) beginning with a letter. Identifiers cannot be reserved words. Comments can appear between any two tokens. There are two forms of comment: one is delimited by /* and */ and can be nested; the other begins with // and is delimited by the end of line and this type of comments may not be nested.

3. Semantics

Declaration made outside a function (including main) are global in scope. Declarations inside a function are local in scope to that function. Function arguments are passed-by-value. Variables or constants cannot be declared using the void type. The skip statement does nothing.

ccal-compiler's People

Stargazers

 avatar

Watchers

 avatar

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.