GithubHelp home page GithubHelp logo

sk-azraf-sami / piratescript-compiler-design Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 785 KB

Welcome to the high seas of programming with PirateScript, a language as adventurous and cunning as a pirate on the hunt for buried treasure. PirateScript be more than just a set of code rules; it's a linguistic journey through the seven seas of syntax and semantics, where every line of code tells a tale of daring escapades and nautical exploits.

License: MIT License

Lex 1.68% C 92.01% Yacc 6.20% Shell 0.11%
abstract-syntax-tree bison bison-flex bison-yacc compiler-design grammar-parser grammer-checker lexical-analysis lexical-parser

piratescript-compiler-design's Introduction

PirateScript-Compiler-Design

coding

Introduction to PirateScript: A Programming Language with a Swashbuckling Twist Ahoy, ye scallywags and code enthusiasts! Welcome to the high seas of programming with PirateScript, a language as adventurous and cunning as a pirate on the hunt for buried treasure. PirateScript be more than just a set of code rules; it's a linguistic journey through the seven seas of syntax and semantics, where every line of code tells a tale of daring escapades and nautical exploits.

Setting Sail with PirateScript: The Basics PirateScript be designed for both seasoned developers and landlubbers lookin' to embark on a voyage into the world of programming. With its unique blend of traditional programming constructs and the whimsy of the pirate's life, it be language that be as fun to write as it be to read.

Variable Types

JackSparrow_i (integer)

Description: The variable JackSparrow_i is an integer used to represent a numeric value associated with the legendary pirate Jack Sparrow.

Usage: This variable is intended to store whole number values, such as counts, indices, or any other integer-related information in the context of the program.

Fury_f (float)

Description: The variable Fury_f is a float used to represent a numeric value associated with the concept of fury or intensity.

Usage: This variable is suitable for storing decimal or floating-point values, providing precision for computations involving non-integer numbers.

Charlotte_c (char)

Description: The variable Charlotte_c is a character variable designed to store a single character, specifically associated with the character "Charlotte."

Usage: This variable is intended for holding single character values, such as letters, digits, or special characters.

DavyJones_d (double)

Description: The variable DavyJones_d is a double used to represent a numeric value associated with the legendary character Davy Jones.

Usage: This variable is suitable for storing double-precision floating-point values, providing higher precision compared to the float data type.

Variable Declaration

Syntax:

pirate_<variable_name>

Example:

JackSparrow_i pirate_a

Here, "JackSparrow_i" is the data type, and by starting with "pirate_", it signifies a variable. "a" is the variable name.

Variable Initialization

Syntax:

pirate_<variable_name> loot value

Example:

pirate_a loot 8

Here, "loot" is the assignment keyword, and it assigns the value 8 to the variable "pirate_a."

Comments

Single Line:

๐Ÿ“๏ธBlack Perl

Multi-Line:

๐Ÿ“Œ๏ธ Jack Sparrow
Pirate Captain
๐Ÿ“Œ๏ธ

Operators

Arithmetic Operators:

  • "booty" (Plus)
  • "mutiny" (Minus)
  • "gun" (Multiplication)
  • "gold" (Division)

Unary Operators:

  • "โš“๏ธ++" (Increment)
  • "โš“๏ธ--" (Decrement)
  • "!โš“๏ธ" (Not)

Logical Operators:

  • "&&" (Logical AND)
  • "||" (Logical OR)
  • "!!" (Logical NOT)

Relational Operators:

  • "tiny" (Less than)
  • "mighty" (Greater than)

Conditional Statements

  • "Parley" (If)
  • "Aye" (Else)
  • "ElseWise" (Else If)

Switch Statement

  • "Pirate_Code" (Case)
  • "Code_Book" (Switch)

Loops

  • "Shanty" (For)
  • "Whale" (While)

Functions

  • "Captain" (Main function)
  • "crew" (User-defined function)
  • "gunPowder" (Power function)
  • "fact" (Factorial function)

Additional Syntax

  • "LeftCannon " (Left first bracket)
  • "RightCannon " (Right first bracket)
  • "yo_ho" (Comma)
  • "๐Ÿดโ€โ˜ ๏ธ๏ธ" (Statement indicator)
  • "LeftBow" (Left second bracket)
  • "RightBow" (Right second bracket)

Feel free to use this documentation to create a PirateScript! Yo-ho...

piratescript-compiler-design's People

Contributors

sk-azraf-sami 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.