View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
farg: a pedestrian M-file parser showing all used functions' syntax

5.0 | 1 rating Rate this file 6 Downloads (last 30 days) File Size: 20.1 KB File ID: #15924 Version: 1.8
image thumbnail

farg: a pedestrian M-file parser showing all used functions' syntax


us (view profile)


14 Aug 2007 (Updated )

parses an M-file searching for functions and prints their exact, literal syntax

| Watch this File

File Information

FARG parses an M-file (function or script) searching for function tags and lists their exact, literal syntax.

in addition, FARG displays a wide variety of file statistics.

currently, these functions are detected and listed
- main function
- subfunctions
- nested functions
- anonymous functions
- eval class calls
- unresolved calls

whitespaces and continuation statements are removed for better readability of the function syntax.

if the lex parser encounters fatal errors, it will stop processing and print a list of the offending syntax.

tested under r2007a, older version 7 systems might work as well.

>> help farg
and the accompanying published M-file for information and a few self-explanatory examples.


This file inspired Fdep: A Pedestrian Function Dependencies Finder, Ftoc (V1.2), and Plot Subfun.

MATLAB release MATLAB 7.4 (R2007a)
Other requirements optimized for R2010a tested with version 2007a
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
05 Nov 2010 Selva Haran

It is a very useful utility. Is it possible to list the actual parameters passed to each function call (not just the formal parameters used in the function definition)? Note that this may vary across calls to the same function. Thanks.

Comment only
16 Apr 2010 Joao Henriques

Joao Henriques (view profile)

14 Mar 2009 us

us (view profile)

unlike FARG, M2HTML dose not
- distinguish between subfunctions and nested functions
- extract anonymous functions
- extract f/eval constructs

moreover, it is a standalone function that does not require other files and subfolders nor the web browser to display its result

just a few pedestrian thoughts...

Comment only
13 Mar 2009 Justine Walker

Very pedestrian indeed: See M2HTML

Comment only
15 Aug 2007

added option to suppress opentoline format, added an example script with erroneous syntax in the html file; version tag is 15-Aug-2007 03:56:40

18 Aug 2007

small changes in the html for better readability; version tag is 16-Aug-2007 04:17:10

27 Aug 2007

added an example of how FARG deals with parentheses in certain ANONYMOUS functions; version tag 27-Aug-2007 15:15:58

27 Aug 2007

uploading does not seem to work; version tag is 27-Aug-2007 19:27:56

30 Oct 2007

added debug option, which will save the lex parser engine (see help); version tag is 29-Oct-2007 17:49:25

30 Oct 2007

removed an annoying debug printout; version tag still 29-Oct-2007 17:49:25

30 Oct 2007

last update did not seem to work! version tag 29-Oct-2007 17:49:25
file date must be 30-Oct-2007 12:49:10

08 Jun 2009 1.1

added more options and file statistics items; shows unresolved and EVAL class calls; version tag 08-Jun-2009 22:24:04

18 Jun 2009 1.4

parser now accepts meta method class descriptors; version tag 18-Jun-2009 09:41:48

26 May 2010 1.5

changes in the lint-engine for r2010+; version tag 26-May-2010 11:15:24

20 Jun 2010 1.8

all files now are read by very fast low-level i/o subroutines; version tag 21-Jun-2010 02:16:38

Contact us