Giter VIP home page Giter VIP logo

pascal's Introduction

README

Language Implementation

What It Is. This Pascal implementation is a traditional, Pascal compiler tool suite with many enhancement for compatibility with modern Pascal usage. The tool suit include a compiler, optimizer, linker, lister, and run-time package. It targets a 16-bit, emulated stack machine that is implemented as a virtual machine by the run-time logic.

Refer to the PascalNotes.md file in the docs sub-directory for more language-oriented discussion.

What It Is Not. This Pascal Implementation would not be the best choice for desk-top application; it does not have a feature set that is as rich as other desk-top Pascal tool suites. It's virtual machine would probably not be optimal for the desk-top environement. But neither is it a tiny, minimal Pascal tool set. Although traditional and not object-based, it is a rather comple Pascal implementation suitable for significant developments.

Embedded Pascal. The environment where the Pascal compiler would be a good choice would probably be the embedded environment. The run-time builds on the standard C library and expects little more from the hardware platform. An RTOS environment or, perhaps, even a bare-metal environment would be a good fit. A port to NuttX is provided.

Configuring Pascal

The Pascal configuration is based on kconfig-frontends tools extracted from the Linux kernel. As of this writing, there is no officially maintainer for these tools. The kconfig-frontends are often available as an installable package under Linx distrubitions. A source snapshot and build instructions are avaiable at https://bitbucket.org/nuttx/tools/src/master/

$ cd *pascal-directory*
$ make menuconfig

Building Pascal Under Linux

The build system has been well excercised under a GNU development environment, in particular, the Cygwin environment. Because it is the same GNU environment, Linux should also build with no issues. No attempt has been made to verify the build under BSD environments (including macOS).

$ cd *pascal-directory*
$ make

Building Pascal Under NuttX

NuttX is a mature, open-source RTOS that runs on many MCUs. When building for NuttX, you need to cross compile the code on a host machine. Code under tools/, for example must always build in the host environment. And the run-time code must always be built for the target MCU environment. It is an option whether you want to host the build tools (compiler, optimizer, linker, lister, etc) on the host cross-development environment or on the target itself.

  1. Before configuring NuttX, create a symbolic link to the Pascal root directory in the NuttX apps directory:

    $ cd nuttx-apps-directory $ ln -s pascal-directory pascal

  2. Then configure NuttX using the board board configuration of your choice. Make sure to enable Pascal support in the Application Configuration menu.

    $ cd nuttx-directory $ make menuconfig

    The most important decision to make in the configuration is if you want to host the entire Pascal development toolchain on the target. That does not require as much memory as you might think, but neither is it for the memory-limited embedded platform.

    The run-time alone has value because you can code, compile, and link Pascal programs on the host, then run them on the target.

  3. And make in the nuttx-directory

    $ cd nuttx-directory $ make

And you should have the Pascal components that you have selected in your board's flash image.

Tips:

  • Select the NuttX readline() function with CONFIG_SYSTEM_READLINE=y. By default fgets is used and the NuttX fgets does not behave in the expected way.

pascal's People

Contributors

gregory-nutt avatar dram avatar

Stargazers

Mohammed Alotaibi avatar Hiperión avatar  avatar  avatar Lup Yuen Lee avatar

Watchers

 avatar  avatar

pascal's Issues

Pascal

Hi, unzip the Pascal on
osboxes@osboxes:~/nuttx$ ls
apps  nuttx  Pascal
osboxes@osboxes:~/nuttx$

in nuttx/apps i type
ln -s /home/osboxes/nuttx/Pascal

then
./tools/configure.sh esp32-devkitc:nsh

and got

mkkconfig in /home/osboxes/nuttx/apps/industry
make[3]: Leaving directory '/home/osboxes/nuttx/apps/industry'
mkkconfig in /home/osboxes/nuttx/apps
make[2]: Leaving directory '/home/osboxes/nuttx/apps'
make[1]: Leaving directory '/home/osboxes/nuttx/nuttx'
**/home/osboxes/nuttx/Pascal/papps/Kconfig.papps:23:warning: ignoring unsupported character '$'**
#
# configuration written to .config
#

in nuttx/apps i can see pascal

osboxes@osboxes:~/nuttx/apps$ dir
Application.mk	crypto		fsutils   include	LICENSE    mlearning  nshlib	 system
boot		Directory.mk	gpsutils  industry	Make.defs  modbus     pascal	 testing
builtin		DISCLAIMER-WIP	graphics  interpreters	Makefile   netutils   platform	 tools
canutils	examples	import	  Kconfig	math	   NOTICE     README.md  wireless
osboxes@osboxes:~/nuttx/apps$ cd pascal
osboxes@osboxes:~/nuttx/apps/pascal$ 

And no Pascal on make menuconfig

But, after going into the pascal folder, i executed make menuconfig, then back to nuttx nutxx folder and now i can see on make menuconfig the pascal option

compiling but got this error

make[4]: Leaving directory '/home/osboxes/nuttx/Pascal/tools'
make[4]: Entering directory '/home/osboxes/nuttx/Pascal/insn16'
make[5]: Entering directory '/home/osboxes/nuttx/Pascal/insn16/libexec'
CC:  libexec_runloop.c
CC:  libexec_debug.c
libexec_debug.c:69:25: warning: 'enum command_e' declared inside parameter list will not be visible outside of this definition or declaration
                    enum command_e cmd, uint32_t value);
                         ^~~~~~~~~
libexec_debug.c:118:57: warning: 'enum command_e' declared inside parameter list will not be visible outside of this definition or declaration
 static void pdbg_ExecCommand(struct libexec_s *st, enum command_e cmd, uint32_t value)
                                                         ^~~~~~~~~
libexec_debug.c:118:67: error: parameter 2 ('cmd') has incomplete type
 static void pdbg_ExecCommand(struct libexec_s *st, enum command_e cmd, uint32_t value)
                                                    ~~~~~~~~~~~~~~~^~~
libexec_debug.c: In function 'pdbg_ExecCommand':
libexec_debug.c:122:5: error: 'struct libexec_s' has no member named 'lastCmd'
   st->lastCmd   = cmd;
     ^~
libexec_debug.c:123:5: error: 'struct libexec_s' has no member named 'lastValue'
   st->lastValue = value;
     ^~
libexec_debug.c:127:10: error: 'eCMD_NONE' undeclared (first use in this function); did you mean 'eOPEN_NONE'?
     case eCMD_NONE:   /* Do nothing */
          ^~~~~~~~~
          eOPEN_NONE
libexec_debug.c:127:10: note: each undeclared identifier is reported only once for each function it appears in
libexec_debug.c:130:10: error: 'eCMD_RESET' undeclared (first use in this function); did you mean 'ECONNRESET'?
     case eCMD_RESET:  /* Reset */
          ^~~~~~~~~~
          ECONNRESET
libexec_debug.c:134:9: error: 'struct libexec_s' has no member named 'lastCmd'
       st->lastCmd = eCMD_NONE;
         ^~
libexec_debug.c:137:10: error: 'eCMD_RUN' undeclared (first use in this function)
     case eCMD_RUN:    /* Run */
          ^~~~~~~~
libexec_debug.c:144:10: error: 'eCMD_STEP' undeclared (first use in this function)
     case eCMD_STEP:   /* Single Step (into)*/
.
.
.

Looks that now is config option on Make menuconfig, right 

Thanks!




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.