Browse files

phptokens

  • Loading branch information...
1 parent 23447eb commit 980676ac661c71060b4eb811e82dbbc27301ff11 @holdenk committed Sep 1, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 php_tokens.php
View
12 php_tokens.php
@@ -0,0 +1,12 @@
+<?php
+
+require_once 'PHP/Token/Stream/Autoload.php';
+require_once 'PHP/Token/Stream.php';
+$ts = new PHP_Token_Stream($argv[1]);
+foreach ($ts as $token) {
+ $type = get_class($token);
+ $line = $token->getLine();
+ $token_txt = chop($token);
+ print "$line:$type:$token_txt\n";
+}
+?>

0 comments on commit 980676a

Please sign in to comment.