PHPoC vs PHP > Overview. Overview

Similar documents
PHPoC. PHPoC vs PHP. Version 1.1. Sollae Systems Co., Ttd. PHPoC Forum: Homepage:

PHPoC Language Reference > Overview. Overview

Operators. Java operators are classified into three categories:

CS313D: ADVANCED PROGRAMMING LANGUAGE

DEPARTMENT OF MATHS, MJ COLLEGE

Character Set. The character set of C represents alphabet, digit or any symbol used to represent information. Digits 0, 1, 2, 3, 9

Princeton University COS 333: Advanced Programming Techniques A Subset of PHP


B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition

A complex expression to evaluate we need to reduce it to a series of simple expressions. E.g * 7 =>2+ 35 => 37. E.g.

Creating a C++ Program

CSC 1214: Object-Oriented Programming

Fundamental of Programming (C)

Introduction. Following are the types of operators: Unary requires a single operand Binary requires two operands Ternary requires three operands

Computer Components. Software{ User Programs. Operating System. Hardware

Operators in C. Staff Incharge: S.Sasirekha

SECTION II: LANGUAGE BASICS

Objectives. Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments

Language Reference Manual simplicity

UNIT- 3 Introduction to C++

CHIL CSS HTML Integrated Language

CprE 288 Introduction to Embedded Systems Exam 1 Review. 1

Information Science 1

CGS 3066: Spring 2015 JavaScript Reference

Model Viva Questions for Programming in C lab

Laboratory 0 Week 0 Advanced Structured Programming An Introduction to Visual Studio and C++

BASIC ELEMENTS OF A COMPUTER PROGRAM

PHP Personal Home Page PHP: Hypertext Preprocessor (Lecture 35-37)

PHP: The Basics CISC 282. October 18, Approach Thus Far

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards

Language Reference Manual

Java Notes. 10th ICSE. Saravanan Ganesh

Variables and Operators 2/20/01 Lecture #

YOLOP Language Reference Manual

Web Scripting using PHP

.Net Technologies. Components of.net Framework

Introduction to C# Applications

Fundamentals of Programming

A flow chart is a graphical or symbolic representation of a process.

EDIABAS BEST/2 LANGUAGE DESCRIPTION. VERSION 6b. Electronic Diagnostic Basic System EDIABAS - BEST/2 LANGUAGE DESCRIPTION

Computer Science & Information Technology (CS) Rank under AIR 100. Examination Oriented Theory, Practice Set Key concepts, Analysis & Summary

C-LANGUAGE CURRICULAM

JavaScript CS 4640 Programming Languages for Web Applications

Introduction to C++ Introduction. Structure of a C++ Program. Structure of a C++ Program. C++ widely-used general-purpose programming language

PHP. Interactive Web Systems

COMP519 Web Programming Lecture 27: PHP (Part 3) Handouts

Data Types and Variables in C language

Introduction to C++ with content from

DETAILED SYLLABUS INTRODUCTION TO C LANGUAGE

C Programming Multiple. Choice

Basic C Programming (2) Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

C/Java Syntax. January 13, Slides by Mark Hancock (adapted from notes by Craig Schock)

C/Java Syntax. Lecture 02 Summary. Keywords Variable Declarations Data Types Operators Statements. Functions. if, switch, while, do-while, for

COMP 202 Java in one week

C++ Programming: From Problem Analysis to Program Design, Third Edition

SAINT2. System Analysis Interface Tool 2. Emulation User Guide. Version 2.5. May 27, Copyright Delphi Automotive Systems Corporation 2009, 2010

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

C++ character set Letters:- A-Z, a-z Digits:- 0 to 9 Special Symbols:- space + - / ( ) [ ] =! = < >, $ # ; :? & White Spaces:- Blank Space, Horizontal

CSC Web Programming. Introduction to JavaScript

Review of the C Programming Language for Principles of Operating Systems

3. Java - Language Constructs I

Computer Components. Software{ User Programs. Operating System. Hardware

Java Basic Programming Constructs

Programming for the Web with PHP

Lexical Considerations

CSCE 110 PROGRAMMING FUNDAMENTALS

Review of the C Programming Language

High Performance Computing in C and C++

CHAD Language Reference Manual

TABLE OF CONTENTS LIST OF ILLUSTRATIONS

XC Specification. 1 Lexical Conventions. 1.1 Tokens. The specification given in this document describes version 1.0 of XC.

Sir Muhammad Naveed. Arslan Ahmed Shaad ( ) Muhammad Bilal ( )

Unit-II Programming and Problem Solving (BE1/4 CSE-2)

Writing Program in C Expressions and Control Structures (Selection Statements and Loops)

C++ Basics. Data Processing Course, I. Hrivnacova, IPN Orsay

Lecture 02 Summary. C/Java Syntax 1/14/2009. Keywords Variable Declarations Data Types Operators Statements. Functions

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

Assignment: 1. (Unit-1 Flowchart and Algorithm)

JavaScript CS 4640 Programming Languages for Web Applications

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

Simple Java Reference

COMP284 Scripting Languages Lecture 11: PHP (Part 3) Handouts

Unit 3. Operators. School of Science and Technology INTRODUCTION

Internet & World Wide Web How to Program, 5/e by Pearson Education, Inc. All Rights Reserved.

Name :. Roll No. :... Invigilator s Signature : INTRODUCTION TO PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

JAVA OPERATORS GENERAL

Java+- Language Reference Manual

UNIT IV 2 MARKS. ( Word to PDF Converter - Unregistered ) FUNDAMENTALS OF COMPUTING & COMPUTER PROGRAMMING

Java Primer 1: Types, Classes and Operators

Quick Reference Guide

OBJECT ORIENTED PROGRAMMING

B. V. Patel Institute of BMC & IT 2014

BoredGames Language Reference Manual A Language for Board Games. Brandon Kessler (bpk2107) and Kristen Wise (kew2132)

QUIZ. 1. Explain the meaning of the angle brackets in the declaration of v below:

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

Le L c e t c ur u e e 2 To T p o i p c i s c t o o b e b e co c v o e v r e ed e Variables Operators

CAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE

BITG 1233: Introduction to C++

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program

Transcription:

PHPoC vs PHP > Overview Overview PHPoC is a programming language that Sollae Systems has developed. All of our PHPoC products have PHPoC interpreter in firmware. PHPoC is based on a wide use script language PHP. As PHPoC is simple, whoever has seen the programming language once can use it easily. There are a few limitations due to embedded systems' characteristic even if PHPoC is basically compatible with PHP. We recommend you to read this page before using the product. 2018-05-17 Sollae Systems page 1 of 16

PHPoC vs PHP > Features of PHPoC > Basic Grammar Basic Grammar Comment Not support for #, single line comment. 2018-05-17 Sollae Systems page 2 of 16

PHPoC vs PHP > Features of PHPoC > Types Types Booleans String "0" will be not FALSE but TRUE when being converted to Boolean. Integers the maximum value of an integer is about 9.2*10 18 in PHPoC. Classes Not support for classes. Arrays Features are as follows: Initial value should be assigned in their declaration. Only number is acceptable to KEY value. Not support for array generation or functional call with a square bracket. Examples <?php // Example 1 $var0 = array(3, 7, "array", "test"); $int0 = $var0[0] + $var0[1]; $str0 = $var0[2]. " ". $var0[3];?> <?php // Example 2 $int0 = 3; $int1 = 7; $str0 = "array"; $str1 = "test"; $var1 = array($int0, $int1, $str0, $str1);?> <?php // Example 3 $str0 = "array test"; $str0[6] = "T"; $str0[7] = "E"; $str0[8] = "S"; 2018-05-17 Sollae Systems page 3 of 16

PHPoC vs PHP > Features of PHPoC > Types $str0[9] = "T"; echo $str0; // Output : array TEST?> Null Not support for Null. Type Juggling Arithmetic Operator: addition(+), subtraction(-), multiplication(*), division(/) Types Boolean Integer Floating Point String Boolean X X X X Integer X O O X Floating Point X O O X String X X X X Arithmetic Operator: the rest(%) Types Boolean Integer Floating Point String Boolean X X X X Integer X O X X Floating Point X X X X String X X X X Bitwise Operator: AND(&), OR( ), XOR(^), left shift(<<), right shift(>>) Types Boolean Integer Floating Point String Boolean X X X X Integer X O X X Floating Point X X X X String X X X X Bitwise Operator: compliment(~) Boolean Integer Floating Point String X O X X Comparison Operator: less than(<), greater than(>), less or equal(<=), greater or equal(>=) Types Boolean Integer Floating Point String Boolean X X X X Integer X O O X Floating Point X O O X String X X X O Comparison Operator: equal(==), not equal(!=), not equal(<>) Types Boolean Integer Floating Point String Boolean O X X X Integer X O X X Floating Point X X O X String X X X O Increment/Decrement Operator: increment(++), decrement(--) 2018-05-17 Sollae Systems page 4 of 16

Boolean Integer Floating Point String X O X X Logical Operator: AND(&&), OR( ) PHPoC vs PHP > Features of PHPoC > Types Types Boolean Integer Floating Point String Boolean O O X O Integer O O X O Floating Point X X O X String O O X O Logical Operator: NOT(!) Boolean Integer Floating Point String O O X O Sign Operator: positive(+), negative(-) Boolean Integer Floating Point String X O O X Expression in Control Structure: if, for, (do) while Boolean Integer Floating Point String O O X O printf function output format Types Boolean Integer Floating Point String %b, %o, %x X O X X %d, %u X O X X %c X O X X %e, %f, %g X X O X %s X X X O 2018-05-17 Sollae Systems page 5 of 16

PHPoC vs PHP > Features of PHPoC > Variables Variables Variables Definition Initial value should be assigned when you declare variables. You cannot declare more than 2 variables in single line. Max size of variable's name is 32 bytes. If it exceeds the max length, the rest are ignored. Variable Variables Not support for variable variables. 2018-05-17 Sollae Systems page 6 of 16

PHPoC vs PHP > Features of PHPoC > Constants Constants Constants Definition Not support for declaring constants with 'const' keyword. Predefined Constants PHPoC provides several predefined constants. Refer to the appendix for more details. 2018-05-17 Sollae Systems page 7 of 16

PHPoC vs PHP > Features of PHPoC > Operators Operators Operator Precedence Precedence Operator Mark Operators [ ( Parenthesis ++ -- ~ (int) (string) (bool) Types / Increment / Decrement! Logical * / % Arithmetic + -. Arithmetic <> Bitwise < <= > >= Comparison ==!= ===!== <> Comparison High Low & Bitwise ^ Bitwise Bitwise && Logical Logical? : Ternary = += -= *= /=.= %= &= = ^= <>= Assignment Arighmetic Operators The result of arithmetic operations between integers is always integer at PHPoC. PHPoC <?php $a = 3; $b = 2; echo $a / $b; // Output: 1(Integer)?> PHP <?php $a = 3; $b = 2; echo $a / $b; // Output: 1.5?> Error Control Operators Not support for error control operators(@). 2018-05-17 Sollae Systems page 8 of 16

PHPoC vs PHP > Features of PHPoC > Operators Excecution Operators Not support for execution operators(` `). Logical Operators Logical operators only accept mark ('!', '&&', ' ' and '^') but not accepts letter (NOT, AND, OR, and XOR). Array Operators Not support for array operators (Union, Equality, Identity and etc.). 2018-05-17 Sollae Systems page 9 of 16

PHPoC vs PHP > Features of PHPoC > Control Structures Control Structures Control Structures Not support for control structure as follows. foreach, declare, require, require_once, goto and label Alternative Syntax for Control Structures Not support for any alternative syntax for control structure (':', endif, endwhile and etc.). Switch It is not acceptable to use ';' (semicolon) instead of ':' (colon) after case expression of switch statement. 2018-05-17 Sollae Systems page 10 of 16

PHPoC vs PHP > Features of PHPoC > Functions Functions Funtion Definition In PHPoC, function has to be declared before being called. Meanwhile, PHP can call function before declaring. Function Arguments It is not allowed to use the duplicated argument names in a user-defined function. Returning Values If there is no returning value, user-defined function returns zero (0) instead of NULL. Not support for returning by reference. Variable Functions Not support for variable functions. Anonymous functions Not support for anonymous functions Internal Functions PHPoC supports for various internal functions. Refer to a document named PHPoC Internal Functions to know how to use those functions. 2018-05-17 Sollae Systems page 11 of 16

PHPoC vs PHP > Features of PHPoC > Namespaces Namespaces User-defined Namespaces Not support for User-defined Namespaces. Function Arguments Keywords, functions and constants share namespaces. Be careful not to make the same name of those when you create them. 2018-05-17 Sollae Systems page 12 of 16

PHPoC vs PHP > Appendix > Predefined Constants Predefined Constants PHPoC provides predefined constants as follows. Name Description Value COUNT_NORMAL Normal Counting for one-dimension array 0 COUNT_RECURSIVE Recursive Counting for multi-dimension array 1 EPIPE Broken Pipe, Returned as connection is broken while sending TCP data 32 (0x20) EBUSY Device or Resource Busy 16 (0x10) ENOENT Not exist in file entry 2 FALSE False 0 M_PI Pi 3.141592653589793 M_E Euler's Constant 2.718281828459045 O_NODIE Avoid php die due to file open 4 MAX_STRING_LEN Maximum length of a string variable 1,534 PHP_VERSION_ID PHPoC Version - SEEK_SET File pointer position: at the beginning of file 0 SEEK_CUR File pointer position: current position of file 1 SEEK_END File pointer position: at the end of file 2 SSL_CONNECTED SSL status: connected 19 (0x13) SSL_CLOSED SSL status: not connected 0 SSL_LISTEN SSL status: wait for connection 1 TRUE Ture 1 TCP_CLOSED TCP status: not connected 0 TCP_LISTEN TCP status: wait for connection 1 TCP_CONNECTED TCP status: connected 4 2018-05-17 Sollae Systems page 13 of 16

PHPoC vs PHP > Appendix > Keyword Keyword The table below shows the predefined keywords in PHPoC. Since keywords, functions and constants share namespace, do not use duplicated names with those keywords when creating functions or constants. a b c d e g i p r s w Alphabet array bool boolean break case const continue default define die do echo else elseif exit global goto if int integer include include_once print return static string switch while Predefined Keywords 2018-05-17 Sollae Systems page 14 of 16

PHPoC vs PHP > Appendix > Restriction about Memory Restriction about Memory Number of Variables PHPoC is limited memory size for using variables. Thus, both the number of variables and the length of string variables are limited. The max number for variable creation is in inverse proportion to the size of variables. 2018-05-17 Sollae Systems page 15 of 16

PHPoC vs PHP > Appendix > Error Messages Error Messages PHPoC prints various error messages out for debugging by console. Error Messages address already in use argument count mismatch cannot break/continue N level(s) 'case' or 'default' expected device or resource busy divided by zero duplicated name expression syntax error file name too long file not found function not implemented integer number too large invalid argument invalid constant name invalid device or address maximum execution time exceeded missing operator missing terminating character ''' or '"' modifiable value required only variable can be passed by reference operation not permitted out of memory string too long syntax error syntax error, unexpected array [, expecting 'token'] syntax error, unexpected character syntax error, unexpected 'character' [, expecting 'character'] syntax error, unexpected end of file syntax error, unexpected 'name' [, expecting 'character'] syntax error, unexpected number [, expecting 'character'] syntax error, unexpected 'operator' [, expecting 'token'] syntax error, unexpected string [, expecting 'character'] syntax error, unexpected 'token' [, expecting 'token'] syntax error, unexpected variable [, expecting 'character'] too many open files undefined name undefined offset unsupported argument type unsupported operand type unsupported operator unsupported pid unsupported type juggling 'while' expected 2018-05-17 Sollae Systems page 16 of 16