We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d0a8cf commit 8ef10ceCopy full SHA for 8ef10ce
examples/polish-notation-calc/php/.gitignore
@@ -1,2 +1,3 @@
1
-lexer.*
2
-parser.*
+Lexer.*
+Parser.*
3
+*.txt
examples/polish-notation-calc/php/main.php
@@ -0,0 +1,12 @@
+<?php
+namespace Alpaca;
+
4
+require './Lexer.php';
5
6
+$debug = $argv[1] == '-d';
7
+while($f = fgets(STDIN)){
8
+ $lexer = new Lexer(rtrim($f), $debug);
9
+ while(($token = $lexer->getNextToken())[0] !== Lexer::TOKEN_TYPE_EOF) {
10
+ echo(Lexer::tokenToString($token[0]) . ", " . $token[1] . "\n");
11
+ }
12
+}
examples/polish-notation-calc/php/test.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+${alpaca:-alpaca} -l php $args syntax.xy &&\
+ php main.php "$@" <<< "$input"
0 commit comments