Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ Lua4.0 interpreter documents     - How to extend / remove swap partitions (Linux)

- Learning C ++ Standard Template Library and data structures (Programming)

- The source code compiler installation Nginx 1.8.0 under Ubuntu 14.10 (Server)

- Teach you how to synchronize Microsoft OneDrive in Linux (Linux)

- Linux can modify the maximum number of open files (Linux)

- Adjustment expand VMDK format VirtualBox disk space (Linux)

- Zorin OS: Linux novice most personal desktop system should be used (Linux)

- sqlplus connect to Oracle (Database)

- CentOS7 yum install third-party source EPEL (Linux)

- How SSHfs mount a remote file system on Linux (Linux)

- OS X CAOpenGLLayer how to enable OpenGL 3.2 core profile (Programming)

- CentOS installation of the ftp (Linux)

- Linux create and delete user step (Linux)

- Wireless LAN security solutions (Linux)

- CentOS 7.0 running Docker kernel error solution (Server)

- Without Visual Studio .NET Windows application development (Programming)

- Use ISO document production OpenStack used CoreOS mirror (Linux)

- Let OS X support NTFS write file (Linux)

- Features and prevention methods elaborate network security grayware (Linux)

- Java inheritance initialization problem (Programming)

  Lua4.0 interpreter documents
  Add Date : 2017-08-31      
  Interpreter document (lua.html)
-------------------------------------------------- -------
first name
lua - Lua interpreter

lua [arguments]

lua independent Lua interpreter. It loads and executes Lua program, the program can be a text source code form, or by the Lua compiler output luac precompiled binary form. lua can be used as a batch interpreter, also be used as an interactive interpreter.

Parameters can be options, assignments, file name, they are executed in sequence from left to right.

Underlined option - start, as described below.

An assignment is a = b as a form of argument that the string 'b' is assigned to the global variable a. Note that if it does not contain spaces or other special characters for the shell, it is not required quotation marks. This is for convenience only. (In general, you should pay attention to when using quotation marks and spaces on the command line, because they are usually processed by the shell.)

If the argument is neither an option nor the assignment, then it is considered to be a file name, and then be loaded and executed.

If no arguments are given, and the standard input is a terminal that it is the "-v -i". Otherwise, that is the -.

- As the standard input file is loaded, that is, not interactively, even if the standard input is a terminal.

Former -c Exit Closes Lua.

-e "stat" statement is executed stat. You need to enclose it in quotation marks if it contains spaces or quotation marks, then.

-f "file" all remaining arguments as a string collection to a global table called arg and execute the file. In arg parameter from zero, it contains the string 'file'. Index of the last parameter is stored in the "arg.n" in.

-i enters interactive mode, a prompt is displayed. In this mode, lua line that reads from standard input and execute them. Each line must contain a complete sentence. To make a sentence span multiple lines, each line can end a backslash '\ e'. See the prompt global variable _PROMPT, if this value is a string. So, to change the prompt, you can put _PROMPT set to a string of your choice. You can then call the interpreter to do this, for example, or write "_PROMPT = \ 'lua: \'" on the command line (Note that you need in quotes, because the string contains a space.). The default prompt is ">."

-q enter interactive mode, but does not display a prompt.

-sn set the stack size to n. If there is, it must be the first option. Note that n and -s in the same parameter. For example, to set a stack size of 2000, you can use -s2000.

-v Output version information.

See also
luac (1)

Error messages should be self-describing.

R. Ierusalimschy, L. H. de Figueiredo, and W. Celes (lua@tecgraf.puc-rio.br)

The client is a simple
It can be loaded from the command line executable files by file name, you can also enter load executable lines of text from the standard.
Note that if the latter case, each line must contain a complete statement.
For example, the function can not cross.
-------------------------------------------------- -------
lua The readme Readme

This is lua, a simple lua interpreter.
It can be used as a batch interpreter or may be used interchangeably.
It has nroff help manual and ../../doc directory html file.

Here are some options that can be identified:
  - As a standard input file execution
  Former -c Exit Closes Lua
  -e stat execution string `stat '
  -f name executable file `name 'and the remaining arguments are placed in the table` arg'
  -i enters interactive mode with the prompt
  -q enter interactive mode without prompt
  -sNUM set the stack size to NUM (must be the first option)
  -v output version information
  a = b set the global variable `a 'string of` b'
  executable file name `name '

If the option is not given, it reads lines from the standard input and execute them. Therefore, each line must contain a complete sentence. To make a sentence span multiple lines can be added at the end of each line backslash '\'.

To change the prompt, you can put _PROMPT set to any value you want. You can then call the interpreter to do this, for example, or you can write lua _PROMPT on the command line = "lua:" -i
Note that in this case you need "-i".

You must pay attention when using quotation marks on the command line, because they are usually handled by the shell.

When the Lua as a separate language, the interpreter well.
If you need a minimum of interpreter, see ../../etc/min.c.

If your application requires a simple function to export a new Lua (which is a very common scenario), then you can use the interpreter (substantially without modification), as follows:

First, define a function
 void myinit (lua_State * L)
In your own code. In this function, you should do any initialization of your application need to export your application to Lua.
Then, add a call lua.c, after the tag
 "Add your libraries here"
After the position.
Of course, you can use any name replace "myinit".
- Bash added to the Vi mode indicator (Linux)
- Ubuntu 14.04 Solution login interface infinite loop (Linux)
- Role Object of registerNatives () method (Programming)
- Analysis of C ++ exception mechanism (Programming)
- Oracle create user authorization and in PLSQL (Database)
- PostgreSQL export data dictionary documents (Database)
- Ubuntu users to install Xtreme Download Manager (Linux)
- Linux more efficient than select a model epoll (Linux)
- Shell script to delete empty folders recursively (Linux)
- Linux under HAProxy + Keepalived dual-availability program (Server)
- 10 Codes of good practice PHP (Programming)
- PULL operation mechanism parsing XML Comments (Programming)
- Let your PHP 7 faster (GCC PGO) (Linux)
- Linux common commands ll namely ls -l --color = auto (Linux)
- Ubuntu 12.04 64-bit installation Redmine + Git + ReviewBoard (Linux)
- Use PXE with kickstart to install Linux automatically (Linux)
- Hadoop2.6.3 build clusters and the development of MapReduce WIN7 by Eclipse on Linux demo (Server)
- Java look and feel mode (Facade mode) (Programming)
- A command to install Sublime Text 3 on Manjaro / Archlinux (Linux)
- Java Collections Framework interfaces map (Programming)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.